Skip to content
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

[e10s] Doesn't work with enabled Electrolysis (multi-process mode) #162

Closed
5 tasks done
Infocatcher opened this issue Nov 25, 2014 · 14 comments
Closed
5 tasks done

Comments

@Infocatcher
Copy link
Owner

Infocatcher commented Nov 25, 2014

See http://forums.mozillazine.org/viewtopic.php?p=13832477#p13832477
Also it's hard to work without fixed bug 1051238 – frame scripts are cached forever & thus can't be updated restartless.
Docs: https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox

Related issues:

@Infocatcher
Copy link
Owner Author

https://bugzilla.mozilla.org/show_bug.cgi?id=1114946 - "Private Tab" add-on does not work with e10s

@Infocatcher
Copy link
Owner Author

Also "private:" protocol doesn't work at all due to bug 940206 – nsIWebContentHandlerRegistrar::registerProtocolHandler doesn't work in e10s

@Infocatcher
Copy link
Owner Author

Also on Nightly there are some wrappers around removeEventListener() (even with disabled e10s!), that doesn't work sometimes.
Looks like <em:multiprocessCompatible>true</em:multiprocessCompatible> in install.rdf fixes that. But this is strange to set that flag for disabled e10s (because still doesn't work for enabled e10s).

@siavash119
Copy link

With Private Tab enabled, I can't change favicon with javascript in firefox e10s tabs (private or not). The javascript works fine and the tabbar updates properly in non-e10s tabs. Here's a quick test script you can run in scratchpad:

(function() {
var link = document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'http://www.stackoverflow.com/favicon.ico';
document.getElementsByTagName('head')[0].appendChild(link);
}());

this may be a good resource: https://developer.mozilla.org/en-US/Add-ons/Working_with_multiprocess_Firefox

@Infocatcher
Copy link
Owner Author

I added a workaround for favicons: 06eab93
This is ugly way (and tab will be assumed as non-private), but looks like there is no way to detect privacy state during some gBrowser.setIcon() calls.

Infocatcher added a commit that referenced this issue Jul 24, 2015
(still doesn't work, but now doesn't throw about security errors)
(#162)
@Infocatcher
Copy link
Owner Author

Some researches:

    toggleTabPrivate: function(tab, isPrivate, _silent) {
        var window = tab.ownerDocument.defaultView;
        var privacyContext = this.getTabPrivacyContext(tab);
        if(!privacyContext) { // Electrolysis
            //~ todo: use content script or something else to handle remote browser
            _log("toggleTabPrivate(): getTabPrivacyContext() failed, will wait");
            var observe = function(subject, topic, data) {
                // Note: subject == tab.linkedBrowser.contentWindow is always false. Don't ask me, why.
                _log("Created content document: " + subject.location);
                if(subject.document == tab.linkedBrowser.contentDocument) {
                    Services.obs.removeObserver(observe, topic);
                    _log("Created content document: " + subject.location + "\nLet's try again");
                    this.toggleTabPrivate(tab, isPrivate, _silent);
                }
            }.bind(this);
            Services.obs.addObserver(observe, "content-document-global-created", false);
            return;
        }

And what we see? Cookies was already sent. :(

@Infocatcher
Copy link
Owner Author

Also too late to toggle private state:

        if(!privacyContext) { // Electrolysis
            //~ todo: use content script or something else to handle remote browser
            _log("toggleTabPrivate(): getTabPrivacyContext() failed, will wait");
            var browser = tab.linkedBrowser;
            var onTabReady = function(e) {
                browser.removeEventListener("DOMWindowCreated", onTabReady, true);
                _log("Received " + e.type + ", let's try again");
                this.toggleTabPrivate(tab, isPrivate, _silent);
            }.bind(this);
            browser.addEventListener("DOMWindowCreated", onTabReady, true);
            return;
        }

@Infocatcher
Copy link
Owner Author

Test version: private_tab-0.1.8pre-fx-sm.xpi (source code).
Please note: many things may not work, but at least some basic things was fixed.

Infocatcher added a commit that referenced this issue Jul 28, 2015
Infocatcher added a commit that referenced this issue Jul 28, 2015
Infocatcher added a commit that referenced this issue Jul 29, 2015
E.g. from privateTab.keypressHandler():
'getModifierState' called on an object that does not implement interface KeyboardEvent.
'preventDefault' called on an object that does not implement interface Event.
(#162, #182)
Infocatcher added a commit that referenced this issue Jul 30, 2015
(better, but still doesn't work)
(#162)
@bogas04
Copy link

bogas04 commented Apr 16, 2016

Favicons aren't displayed for tabs when Private Tabs in enabled on e10s latest nightlies. I've tried refreshing my profile, doesn't help

@Infocatcher
Copy link
Owner Author

Favicons aren't displayed for tabs when Private Tabs in enabled on e10s latest nightlies.

Works fine for me...
Please try latest development version:
private_tab-0.1.9.2pre2-fx-sm.xpi (source code)

@sebadorn
Copy link

sebadorn commented May 6, 2016

I had the same problem: Firefox 48.0a2 with e10s enabled and Private Tab 0.1.9.1.
Now with 0.1.9.2pre2 favicons are working again.

@anewuser
Copy link

anewuser commented Aug 2, 2016

Infocatcher added a commit that referenced this issue Aug 10, 2016
* unsafe CPOW usage (#208)
* updated pt-PT locale (#210)
* e10s: fixed private protocol (#211)
* e10s: tweaks and fixes (#162)
* e10s: single frame script (#213)
* fixed recursion in wrapper for tab.setAttribute("image", …) (#214)
* compatibility with Firefox 51+: broked this.windows getter (#228)
* small internal enhancements and fixes
Infocatcher added a commit that referenced this issue Aug 10, 2016
* unsafe CPOW usage (#208)
* updated pt-PT locale (#210)
* e10s: fixed private protocol (#211)
* e10s: tweaks and fixes (#162)
* e10s: single frame script (#213)
* fixed recursion in wrapper for tab.setAttribute("image", …) (#214)
* compatibility with Firefox 51+: broked this.windows getter (#228)
* small internal enhancements and fixes
Infocatcher added a commit that referenced this issue Aug 10, 2016
* unsafe CPOW usage (#208)
* updated pt-PT locale (#210)
* e10s: fixed private protocol (#211)
* e10s: tweaks and fixes (#162)
* e10s: single frame script (#213)
* fixed recursion in wrapper for tab.setAttribute("image", …) (#214)
* compatibility with Firefox 51+: broked this.windows getter (#228)
* small internal enhancements and fixes
@Infocatcher
Copy link
Owner Author

Most of e10s-related bugs should be fixed:
https://addons.mozilla.org/addon/private-tab/versions/0.2.0

@anewuser
Copy link

@Infocatcher That's great news. Thank you very much for your work on this extension and for not giving up despite all changes done by Mozilla. It's the one thing that keeps me on Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants