Merge pull request #10369 from druiz17/url-fix

Fix tablet webview showing incorrect url.
This commit is contained in:
Zach Fox 2017-05-03 16:58:06 -07:00 committed by GitHub
commit affc7fc654

View file

@ -16,7 +16,6 @@ Item {
property var parentStackItem: null property var parentStackItem: null
property int headerHeight: 70 property int headerHeight: 70
property string url property string url
property alias address: displayUrl.text //for compatibility
property string scriptURL property string scriptURL
property alias eventBridge: eventBridgeWrapper.eventBridge property alias eventBridge: eventBridgeWrapper.eventBridge
property bool keyboardEnabled: HMD.active property bool keyboardEnabled: HMD.active
@ -82,6 +81,7 @@ Item {
color: hifi.colors.baseGray color: hifi.colors.baseGray
font.pixelSize: 12 font.pixelSize: 12
verticalAlignment: Text.AlignLeft verticalAlignment: Text.AlignLeft
text: webview.url
anchors { anchors {
top: nav.bottom top: nav.bottom
horizontalCenter: parent.horizontalCenter; horizontalCenter: parent.horizontalCenter;
@ -159,7 +159,6 @@ Item {
function loadUrl(url) { function loadUrl(url) {
webview.url = url webview.url = url
web.url = webview.url; web.url = webview.url;
web.address = webview.url;
} }
function onInitialPage(url) { function onInitialPage(url) {
@ -253,7 +252,6 @@ Item {
}); });
webview.profile.httpUserAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36"; webview.profile.httpUserAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36";
web.address = url;
} }
onFeaturePermissionRequested: { onFeaturePermissionRequested: {
@ -279,7 +277,6 @@ Item {
} }
if (WebEngineView.LoadSucceededStatus == loadRequest.status) { if (WebEngineView.LoadSucceededStatus == loadRequest.status) {
web.address = webview.url;
if (startingUp) { if (startingUp) {
web.initialPage = webview.url; web.initialPage = webview.url;
startingUp = false; startingUp = false;
@ -308,7 +305,6 @@ Item {
Component.onCompleted: { Component.onCompleted: {
web.isDesktop = (typeof desktop !== "undefined"); web.isDesktop = (typeof desktop !== "undefined");
address = url;
} }
Keys.onPressed: { Keys.onPressed: {