Improve test for presence of `browser` as extensions API

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1914

The issue affected only Chromium-based browsers.
This commit is contained in:
Raymond Hill 2022-01-01 11:07:17 -05:00
parent a611c3f40a
commit d38c19cabf
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,10 @@
/******************************************************************************/
if ( self.browser instanceof Object ) {
if (
self.browser instanceof Object &&
self.browser instanceof Element === false
) {
self.chrome = self.browser;
} else {
self.browser = self.chrome;