Skip to content

Commit

Permalink
Fix compatibility with Firefox 131
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Sep 26, 2024
1 parent cc44d1f commit 529cd72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
6 changes: 6 additions & 0 deletions native/userchrome/profile/chrome/pwa/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@
height: 30px;
}

.site-info > .tab-throbber,
.site-info > .tab-icon-pending,
.site-info > .tab-icon-image {
margin-inline-end: 5.5px;
}

.tab-icon-image {
flex-shrink: 0;
}
Expand Down
24 changes: 7 additions & 17 deletions native/userchrome/profile/chrome/pwa/content/browser.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,16 @@ class PwaBrowser {
const menuItem = this.createElement(document, 'menuitem', { id: 'contextmenu-openlinkdefault', 'data-l10n-id': 'context-menu-open-link-default-browser', oncommand: 'gContextMenu.openLinkInDefaultBrowser()' });
document.getElementById('context-sep-open').before(menuItem)

hookFunction(window, 'openContextMenu', null, () => {
// Handle clicking on it and open link in default browser
nsContextMenu.prototype.openLinkInDefaultBrowser = function () {
MailIntegration._launchExternalUrl(makeURI(this.linkURL));
};

hookFunction(nsContextMenu.prototype, 'initOpenItems', null, function () {
// Display it only when clicked on links
const shouldShow = window.gContextMenu.onSaveableLink || window.gContextMenu.onPlainTextLink;
const shouldShow = this.onSaveableLink || this.onPlainTextLink;
document.getElementById('context-sep-open').hidden = !shouldShow;
menuItem.hidden = !shouldShow;

// Handle clicking on it and open link in default browser
window.gContextMenu.openLinkInDefaultBrowser = function () {
MailIntegration._launchExternalUrl(makeURI(this.linkURL));
};
});
}

Expand Down Expand Up @@ -576,16 +576,6 @@ class PwaBrowser {
return BrowserWindowTracker._openWindow(options);
}
}

// Handle opening new window from context menus
hookFunction(window, 'openContextMenu', null, () => {
gContextMenu.openLink = function () {
return window.openDialog(AppConstants.BROWSER_CHROME_URL, '_blank', 'chrome,all,dialog=no,non-private', this.linkURL);
};
gContextMenu.openLinkInPrivateWindow = function () {
return window.openDialog(AppConstants.BROWSER_CHROME_URL, '_blank', 'chrome,all,dialog=no,private', this.linkURL);
};
});
}

handleDisablingShortcuts () {
Expand Down

0 comments on commit 529cd72

Please sign in to comment.