question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Several `navigator.plugins` inconsistencies

See original GitHub issue

Describe the bug

This is an aggregated bug report for a few inconsistencies that I found in navigator.plugins evasion.

Reference mismatch

Chromium implementation of navigator.plugins array references single PluginData instance (DOMPluginArray::refresh from L103) at both enabledPlugin field, integer and string key of navigator.plugins[] and nested enabledPlugin-s etc.

Code Snippet

// `refMatch` - Headless reports `false` while regular Chrome `true`
const nameMatch = navigator.plugins[0].name === navigator.plugins[0][0].enabledPlugin.name;
const refMatch = navigator.plugins[0][0].enabledPlugin === navigator.plugins[0];

navigator.plugins.refresh is not writable

Code Snippet

// `overrideTest` - Headless reports `false` while regular Chrome `true`
navigator.plugins.refresh = 'test';
const overrideTest = navigator.plugins.refresh === 'test';

item(unsigned long index) overflow

This is related to how V8 handles numerical overflows. This may theoretically have a wider impact than only navigator.plugins but need to be researched.

Code Snippet

// `overflowTest` - Headless reports `false` while regular Chrome `true`
const overflowTest = navigator.plugins.item(4294967296) === navigator.plugins[0];
// this can go on with navigator.plugins.item(4294967297) === navigator.plugins[1]; etc.

<object /> onerror (PDF Viewer)

This is related to how events are fired from the <object />. To demonstrate this one I used a sample PDF file from here: http://www.africau.edu/images/default/sample.pdf

Code Snippet

// ...
await page.goto('http://www.africau.edu/');
const testResult = await page.evaluate(async () => {
        await new Promise(resolve => {
            const obj = document.createElement("object");
            obj.data = "http://www.africau.edu/images/default/sample.pdf"; // A URL with ".pdf" extension. It doesnt have to be a valid PDF document. Anything that's over 0B in size will work.
            obj.onload = function() { resolve(true) }
            obj.onerror = function() { resolve(false) }
            document.body.appendChild(obj);
        })
});
// `testResult` - Headless reports `false` while a regular Chrome `true`

Versions

Most recent.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wwhtrbbttcommented, Oct 30, 2022

these bugs are actively used by cloudflare for bot detection img

0reactions
vladtrenycommented, Dec 6, 2022

levi, happy new year, this plugin is obsolete how i subscribed here

Read more comments on GitHub >

github_iconTop Results From Across the Web

navigator.plugins - How To Create
It is a complete mess. All caused by not just a missing object, but by a completely incorrect implementation of an otherwise very...
Read more >
Critical Error - WordPress.org
Hi,. When Regenerate images is done, between 20% and 30% I get the error message at the bottom of the page: <p>There is...
Read more >
1164635 - Consider hard-coding navigator.plugins ... - Monorail
On Friday, I'll land a CL to return [] for both navigator.plugins and navigator.mimeTypes. 3. We'll see what happens in Canary M90 in...
Read more >
15229 – View errors when launching with out the plugins needed to ...
So this bug is to track that issue with Views and Perspectives which I assume are the province of the UI. These were...
Read more >
The ICMAdminClientPlugin plug-in contains errors messages ...
If Content Navigator is clustered, make sure the JAR file path is identical on all the nodes.) Test with different browser versions and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found