You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i set the url to http://wdg.github.io/HTML-iOS-Template/mac.html
wich contains a test what uses window.webshell.version a.k.a. webshell.version.
i'd need to create a hack because the injecting is somewhat to slow.
The function:
function myFunction() {
if (typeof window.webshell !== 'undefined') {
console.log(window.webshell.version) // works...
} else {
console.error('i\'m missing something')
}
}
the hack:
rdy(function(){myFunction()});
function rdy(f){/in/.test(document.readyState)?setTimeout('rdy('+f+')',9):f()}
this test every 9ms the readyState.
because window.addEventListener is too fast, and injecting to slow.
window.addEventListener(
"load",
function(event) { myFunction() },
true
); // missed it, to early
window.addEventListener(
"load",
function(event) { myFunction() },
false
); // missed it, to early
window.addEventListener(
"DOMContentLoaded",
function(event) { myFunction() },
true
); // missed it, to early
window.addEventListener(
"DOMContentLoaded",
function(event) { myFunction() },
false
); // missed it, to early
Possible solutions:
Try to inject the javascript faster.
Extend WebKit (don't know if it is possible, in this way)
Fire the DOMContentLoaded, load 2 times (last time by WebShell)
The text was updated successfully, but these errors were encountered:
If i set the url to http://wdg.github.io/HTML-iOS-Template/mac.html
wich contains a test what uses
window.webshell.version
a.k.a.webshell.version
.i'd need to create a hack because the injecting is somewhat to slow.
The function:
the hack:
this test every 9ms the readyState.
because
window.addEventListener
is too fast, and injecting to slow.Possible solutions:
The text was updated successfully, but these errors were encountered: