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

Replace startup workaround with persistent listener #206

Open
stoically opened this issue Feb 22, 2019 · 2 comments
Open

Replace startup workaround with persistent listener #206

stoically opened this issue Feb 22, 2019 · 2 comments
Labels
enhancement New feature or request needs-priority This issue needs prioritization

Comments

@stoically
Copy link
Member

The workaround introduced in #78 due to the report in #61 to catch loading Facebook tabs on Firefox startup could potentially be replaced by "persistent listeners" introduced in Bug 1447551.

For a listener to become persistent, it must be added during evaluation/initial execution of the background script. If it happens later (asynchronously or otherwise) then it is not persisted.

This would require to move the webRequest listeners to the global context and make sure to wait inside the listener for the required init work. A short example is here.

@Rob--W
Copy link
Member

Rob--W commented Jan 12, 2022

Someone reported this bug at https://bugzilla.mozilla.org/show_bug.cgi?id=1748999.

It looks like it should be straightforward to resolve this bug, by moving the setupWebRequestListeners call to the start of init at

(async function init () {
await setupMACAddonListeners();
macAddonEnabled = await isMACAddonEnabled();
relayAddonEnabled = await isRelayAddonEnabled();
try {
await setupContainer();
} catch (error) {
// TODO: Needs backup strategy
// See https://github.com/mozilla/contain-facebook/issues/23
// Sometimes this add-on is installed but doesn't get a facebookCookieStoreId ?
// eslint-disable-next-line no-console
console.error(error);
return;
}
clearFacebookCookies();
generateFacebookHostREs();
setupWebRequestListeners();
.

@Myron-S
Copy link

Myron-S commented Jan 12, 2022

Yep. Looks like this has been reported quite some time ago. I'm on 97.0b2 (64-bit) and this issue is present. I caught this because Facebook is logged in within its container, but not anywhere else so I get presented with the standard Facebook login page instead of the page referred to from the desktop shortcut.

Workaround is for me to start Firefox first and then invoke the shortcut on the desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-priority This issue needs prioritization
Projects
None yet
Development

No branches or pull requests

4 participants