diff --git a/src/plugins/GreaseMonkey/data/bootstrap.js b/src/plugins/GreaseMonkey/data/bootstrap.js index 66cf400a0..adb780df6 100644 --- a/src/plugins/GreaseMonkey/data/bootstrap.js +++ b/src/plugins/GreaseMonkey/data/bootstrap.js @@ -84,10 +84,6 @@ function GM_setClipboard(text) { external.extra.greasemonkey.setClipboard(text); } -// Define unsafe window -var unsafeWindow = window; -window.wrappedJSObject = unsafeWindow; - // GM_registerMenuCommand not supported function GM_registerMenuCommand(caption, commandFunc, accessKey) { } diff --git a/src/plugins/GreaseMonkey/data/bootstrap.min.js b/src/plugins/GreaseMonkey/data/bootstrap.min.js index 54b0ce6fc..d1ab16e9d 100644 --- a/src/plugins/GreaseMonkey/data/bootstrap.min.js +++ b/src/plugins/GreaseMonkey/data/bootstrap.min.js @@ -1,4 +1,4 @@ var GM={info:{script:{description:"",excludes:[],includes:[],matches:[],name:"",namespace:"",resources:{},"run-at":"document-end",version:""},scriptMetaStr:"",scriptHandler:"QupZilla GreaseMonkey",version:"4.0"}};window.GM=GM;function GM_info(){return GM.info} function GM_xmlhttpRequest(a){a.method=a.method.toUpperCase()||"GET";if(!a.url)throw"GM_xmlhttpRequest requires an URL.";var b=new XMLHttpRequest;"onreadystatechange"in a&&(b.onreadystatechange=function(){a.onreadystatechange(b)});"onload"in a&&(b.onload=function(){a.onload(b)});"onerror"in a&&(b.onerror=function(){a.onerror(b)});b.open(a.method,a.url,!0);if("headers"in a)for(var c in a.headers)b.setRequestHeader(c,a.headers[c]);"data"in a?b.send(a.data):b.send()} function GM_addStyle(a){var b=document.getElementsByTagName("head")[0];if(void 0===b)document.onreadystatechange=function(){if("interactive"==document.readyState){var b=document.createElement("style");b.setAttribute("type","text/css");b.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(b)}};else{var c=document.createElement("style");c.setAttribute("type","text/css");c.appendChild(document.createTextNode(a));b.appendChild(c)}} -function GM_log(a){console&&console.log(a)}function GM_openInTab(a){return window.open(a)}function GM_setClipboard(a){external.extra.greasemonkey.setClipboard(a)}var unsafeWindow=window;window.wrappedJSObject=unsafeWindow;function GM_registerMenuCommand(a,b,c){}function GM_getResourceUrl(a){}GM.openInTab=GM_openInTab;GM.setClipboard=GM_setClipboard;GM.xmlhttpRequest=GM_xmlhttpRequest;GM.getResourceUrl=function(a){return new Promise(function(a,c){c()})}; +function GM_log(a){console&&console.log(a)}function GM_openInTab(a){return window.open(a)}function GM_setClipboard(a){external.extra.greasemonkey.setClipboard(a)}function GM_registerMenuCommand(a,b,c){}function GM_getResourceUrl(a){}GM.openInTab=GM_openInTab;GM.setClipboard=GM_setClipboard;GM.xmlhttpRequest=GM_xmlhttpRequest;GM.getResourceUrl=function(a){return new Promise(function(a,c){c()})};