-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't open new private tab, if installed Scriptify-based extension #110
Comments
Also failed any codes like privateTab.readyToOpenTab(true);
BrowserOpenTab(); privateTab.readyToOpenTab(true);
gBrowser.selectedTab = gBrowser.addTab("about:"); |
Code for "new private tab" function: https://github.com/Infocatcher/Private_Tab/blob/0.1.5/bootstrap.js#L1549 Yes, we can increase delay in |
Oh, the same issue without // ==UserScript==
// @name Test Scriptify #2
// @namespace dev/null
// @include https://github.com/*
// @version 0.1
// @grant none
// ==/UserScript==
if("console" in window && "log" in console)
console.log("Test Scriptify #2"); http://infocatcher.ucoz.net/test/ext/test-scriptify-2.xpi So, looks like any Scriptify-based extension causes strange things with timeouts and |
Test: var c = 100;
var timerDelay = 0;
var testDelay = 300;
var ok = 0;
var failed = 0;
var tester = asyncTester();
tester.next();
function asyncTester() {
for(var i = 0; i < c; ++i) {
progress("Test: " + i + "/" + c + " (" + Math.round(failed/c*100) + "%)");
asyncTest();
yield 0;
}
progress();
alert(
"OK: " + ok
+ "\nFailed: " + failed + " (" + Math.round(failed/c*100) + "%)"
+ "\nTotal: " + (ok + failed) + "/" + c
);
yield 0;
}
function asyncTest() {
var tabOpened = false;
setTimeout(function() {
if(tabOpened)
++ok;
else
++failed;
}, timerDelay);
var tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
tabOpened = true;
setTimeout(function() {
gBrowser.removeTab(tab);
setTimeout(function() {
tester.next();
}, testDelay);
}, timerDelay);
}
function progress() {
var root = document.documentElement;
var tm = root.getAttribute("titlemodifier");
var tmn = root.getAttribute("titlemodifier_normal");
progress = function(status) {
if(status) {
root.setAttribute("titlemodifier", status);
root.setAttribute("titlemodifier_normal", status);
}
else {
root.setAttribute("titlemodifier", tm);
root.setAttribute("titlemodifier_normal", tmn);
gBrowser.updateTitlebar && gBrowser.updateTitlebar();
}
};
return progress.apply(this, arguments);
} Failed:
|
Additional tests: _log("setTimeout()");
setTimeout(function() {
_log("setTimeout() done");
}, 0);
_log("mainThread.dispatch()");
Services.tm.mainThread.dispatch(function() {
_log("mainThread.dispatch() done");
}, 0);
_log("postMessage()");
delayed(function() {
_log("postMessage() done");
});
_log("addTab()");
gBrowser.selectedTab = gBrowser.addTab("about:");
_log("addTab() done");
function delayed(func) {
var frame = document.createElement("iframe");
frame.setAttribute("collapsed", "true");
document.documentElement.appendChild(frame);
var fw = frame.contentWindow;
fw.addEventListener("message", function onMessage(e) {
fw.removeEventListener("message", onMessage, true);
frame.parentNode.removeChild(frame);
func();
}, true);
fw.postMessage("", "*");
}
function _log(s) {
var d = new Date();
var ms = d.getMilliseconds();
var timestamp = d.toLocaleFormat("%M:%S:") + "000".substr(String(ms).length) + ms;
Services.console.logStringMessage("[test] " + timestamp + " " + s);
} All methods works without Scriptify-based extension and fails otherwise ( |
Should works fine since Scriptify 0.2.6:
But only with browser.tabs.remote = false... |
Reported here: http://forums.mozillazine.org/viewtopic.php?p=13127597#p13127597
Scriptify: https://addons.mozilla.org/firefox/addon/scriptify/
Test extension: https://addons.mozilla.org/firefox/addon/fb-purity-cleans-up-facebook/
Simple test UserScript:
Result: http://infocatcher.ucoz.net/test/ext/test-scriptify.xpi
Looks like Scriptify slowdowns opening of new tabs...
Test code:
Output:
And without Scriptify
setTimeout() done
is always afteraddTab() done
becauseaddTab()
should be synchronous.The text was updated successfully, but these errors were encountered: