aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-15 00:13:21 +0800
committerobscuren <geffobscura@gmail.com>2015-02-15 00:13:21 +0800
commitbefb4bc1c102a62eaad9b4980e54cd4067078c2a (patch)
tree6ccc81c8508e43dff9fced1a7a305813ca66710b /cmd
parent32c7ebc51dcb31f21efe1b9c75f2b86cd216f510 (diff)
downloadgo-tangerine-befb4bc1c102a62eaad9b4980e54cd4067078c2a.tar.gz
go-tangerine-befb4bc1c102a62eaad9b4980e54cd4067078c2a.tar.zst
go-tangerine-befb4bc1c102a62eaad9b4980e54cd4067078c2a.zip
Fixed a few errors in the browser special meta tags objects
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mist/assets/qml/views/browser.qml58
1 files changed, 28 insertions, 30 deletions
diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml
index 3cbabf0b6..ac160e2b1 100644
--- a/cmd/mist/assets/qml/views/browser.qml
+++ b/cmd/mist/assets/qml/views/browser.qml
@@ -334,16 +334,16 @@ Rectangle {
}
z: 10
- Timer {
- interval: 500; running: true; repeat: true
- onTriggered: {
- webview.runJavaScript("document.querySelector('meta[name=badge]').getAttribute('content')", function(badge) {
- if (badge) {
- menuItem.secondaryTitle = badge;
- }
- });
- }
- }
+ Timer {
+ interval: 500; running: true; repeat: true
+ onTriggered: {
+ webview.runJavaScript("try{document.querySelector('meta[name=badge]').getAttribute('content')}catch(e){}", function(badge) {
+ if (badge) {
+ menuItem.secondaryTitle = badge;
+ }
+ });
+ }
+ }
onLoadingChanged: {
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
@@ -351,31 +351,27 @@ Rectangle {
menuItem.title = pageTitle;
});
+ webView.runJavaScript("try{document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")}catch(e){}", function(topBarStyle){
+ if (!topBarStyle) return;
- //var topBarStyle
- webView.runJavaScript("document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")", function(topBarStyle){
if (topBarStyle=="transparent") {
-
// Adjust for a transparent sidebar Dapp
- navBarBackground.visible = false;
- back.visible = false;
- appInfoPane.anchors.leftMargin = -16;
- appInfoPaneShadow.anchors.leftMargin = -16;
- webview.anchors.topMargin = -74;
+ navBarBackground.visible = false;
+ back.visible = false;
+ appInfoPane.anchors.leftMargin = -16;
+ appInfoPaneShadow.anchors.leftMargin = -16;
+ webview.anchors.topMargin = -74;
webview.runJavaScript("document.querySelector('body').classList.add('ethereum-dapp-url-bar-style-transparent')")
} else {
- navBarBackground.visible = true;
- back.visible = true;
- appInfoPane.anchors.leftMargin = 0;
- appInfoPaneShadow.anchors.leftMargin = 0;
- webview.anchors.topMargin = 0;
-
- };
+ navBarBackground.visible = true;
+ back.visible = true;
+ appInfoPane.anchors.leftMargin = 0;
+ appInfoPaneShadow.anchors.leftMargin = 0;
+ webview.anchors.topMargin = 0;
+ };
});
-
-
webview.runJavaScript(eth.readFile("bignumber.min.js"));
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
@@ -383,10 +379,12 @@ Rectangle {
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
var domain = matches && matches[1];
- appDomain.text = domain //webview.url.replace("a", "z")
- appTitle.text = webview.title
+ if (domain)
+ appDomain.text = domain //webview.url.replace("a", "z")
+ if (webview.title)
+ appTitle.text = webview.title
- showFullUrlBar(false);
+ showFullUrlBar(false);
}
}
onJavaScriptConsoleMessage: {