Skip to content

Commit

Permalink
Fix compatibility with Firefox 134 (fixes #600)
Browse files Browse the repository at this point in the history
Because of BZ-1930654 / PHAB-228667, `window._gBrowser` is no longer available immediately on startup, which breaks some code that relies on it. To fix the issue, we need to delay the affected code after the browser has been initialized.

This is quite a hacky solution. In the future, we should rewrite how loading works and find a better solution.
  • Loading branch information
filips123 committed Dec 28, 2024
1 parent 4a0601c commit a5d1da9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions native/userchrome/profile/chrome/pwa/content/browser.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PwaBrowser {
this.moveMenuButtons();
this.switchPopupSides();
this.makeUrlBarReadOnly();
this.setDisplayModeStandalone();
setTimeout(() => { this.setDisplayModeStandalone() });
this.handleRegisteringProtocols();
this.handleOutOfScopeNavigation();
this.handleOpeningNewWindow();
Expand Down Expand Up @@ -96,10 +96,12 @@ class PwaBrowser {
docDS['contentTitleDefault'] = docDS['contentTitlePrivate'] = 'CONTENTTITLE'
docDS['titleDefault'] = docDS['titlePrivate'] = siteName

window.gBrowser.updateTitlebar = function () {
const dynamicTitle = xPref.get(ChromeLoader.PREF_DYNAMIC_WINDOW_TITLE);
if (dynamicTitle) document.title = this.getWindowTitleForBrowser(this.selectedBrowser);
};
setTimeout(() => {
window.gBrowser.updateTitlebar = function () {
const dynamicTitle = xPref.get(ChromeLoader.PREF_DYNAMIC_WINDOW_TITLE);
if (dynamicTitle) document.title = this.getWindowTitleForBrowser(this.selectedBrowser);
};
});

function updateNameAndIcon (source) {
const dynamicIcon = xPref.get(ChromeLoader.PREF_DYNAMIC_WINDOW_ICON);
Expand Down Expand Up @@ -1801,9 +1803,10 @@ class PwaBrowser {

configureAll () {
this.configureLayout();
this.configureWidgets();
this.configureSettings();
this.disableOnboarding();

setTimeout(() => { this.configureWidgets() });
}

configureLayout () {
Expand Down

0 comments on commit a5d1da9

Please sign in to comment.