Skip to content

Commit

Permalink
Enable path for native has() selector in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 21, 2023
1 parent c090ab1 commit c5724c1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion platform/common/vapi-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ vAPI.webextFlavor = {
}
};

// https://bugzilla.mozilla.org/show_bug.cgi?id=1858743
// Add support for native `:has()` for Firefox 121+

(( ) => {
const ua = navigator.userAgent;
const flavor = vAPI.webextFlavor;
Expand Down Expand Up @@ -184,13 +187,16 @@ vAPI.webextFlavor = {
flavor.major = parseInt(info.version, 10) || flavor.major;
soup.add(info.vendor.toLowerCase())
.add(info.name.toLowerCase());
if ( flavor.major >= 121 && soup.has('mobile') === false ) {
soup.add('native_css_has');
}
dispatch();
});
if ( browser.runtime.getURL('').startsWith('moz-extension://') ) {
soup.add('firefox')
.add('user_stylesheet')
.add('html_filtering');
flavor.major = 91;
flavor.major = 115;
}
return;
}
Expand Down

0 comments on commit c5724c1

Please sign in to comment.