Skip to content

Commit c5724c1

Browse files
committed
Enable path for native has() selector in Firefox
Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=1858743
1 parent c090ab1 commit c5724c1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

platform/common/vapi-common.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ vAPI.webextFlavor = {
155155
}
156156
};
157157

158+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1858743
159+
// Add support for native `:has()` for Firefox 121+
160+
158161
(( ) => {
159162
const ua = navigator.userAgent;
160163
const flavor = vAPI.webextFlavor;
@@ -184,13 +187,16 @@ vAPI.webextFlavor = {
184187
flavor.major = parseInt(info.version, 10) || flavor.major;
185188
soup.add(info.vendor.toLowerCase())
186189
.add(info.name.toLowerCase());
190+
if ( flavor.major >= 121 && soup.has('mobile') === false ) {
191+
soup.add('native_css_has');
192+
}
187193
dispatch();
188194
});
189195
if ( browser.runtime.getURL('').startsWith('moz-extension://') ) {
190196
soup.add('firefox')
191197
.add('user_stylesheet')
192198
.add('html_filtering');
193-
flavor.major = 91;
199+
flavor.major = 115;
194200
}
195201
return;
196202
}

0 commit comments

Comments
 (0)