@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
3
3
import QtQuick.Controls.Styles 1.0
4
4
import QtQuick.Layouts 1.0 ;
5
5
import QtWebEngine 1.0
6
- import QtWebEngine.experimental 1.0
6
+ // import QtWebEngine.experimental 1.0
7
7
import QtQuick.Window 2.0 ;
8
8
9
9
Rectangle {
@@ -340,8 +340,8 @@ Rectangle {
340
340
WebEngineView {
341
341
objectName: " webView"
342
342
id: webview
343
- experimental .settings .javascriptCanAccessClipboard : true
344
- experimental .settings .localContentCanAccessRemoteUrls : true
343
+ // experimental.settings.javascriptCanAccessClipboard: true
344
+ // experimental.settings.localContentCanAccessRemoteUrls: true
345
345
anchors {
346
346
left: parent .left
347
347
right: parent .right
@@ -367,7 +367,12 @@ Rectangle {
367
367
menuItem .title = pageTitle;
368
368
});
369
369
370
-
370
+ webView .runJavaScript (" document.querySelector(\" link[rel='icon']\" ).getAttribute(\" href\" )" , function (sideIcon ){
371
+ if (sideIcon){
372
+ menuItem .
icon = " http://localhost:3000/[email protected] "
373
+ };
374
+ });
375
+
371
376
webView .runJavaScript (" try{document.querySelector(\" meta[name='ethereum-dapp-url-bar-style']\" ).getAttribute(\" content\" )}catch(e){}" , function (topBarStyle ){
372
377
if (! topBarStyle) {
373
378
showFullUrlBar (true );
@@ -397,15 +402,9 @@ Rectangle {
397
402
};
398
403
});
399
404
400
- // webView.runJavaScript("document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")", function(sideIcon){
401
- // if(sideIcon){
402
- // window.iconSource = "http://localhost:3000/[email protected] " //webview.url + sideIcon
403
- // console.log(iconSource)
404
- // };
405
- // });
406
-
405
+
407
406
webview .runJavaScript (eth .readFile (" bignumber.min.js" ));
408
- webview .runJavaScript (eth .readFile (" ethereum.js/dist/ethereum.js" ));
407
+ webview .runJavaScript (eth .readFile (" ethereum.js/dist/ethereum.js" ));
409
408
410
409
var cleanTitle = webview .url .toString ()
411
410
var matches = cleanTitle .match (/ ^ [a-z ] * \:\/\/ ([^ \/ ?#] + )(?:[\/ ?#] | $ )/ i );
0 commit comments