Access chrome object in Extensions API
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: v1.5.0
- Platform / OS version: windows
- URLs (if applicable):
- Node.js version: 8.10
What steps will reproduce the problem?
Please include code that reproduces the issue.
I’m trying to disable webRTC local IP leak by using:
await page.evaluateOnNewDocument(() => {
chrome.privacy.network.webRTCIPHandlingPolicy.set({
value: "default_public_interface_only"
});
});
https://developer.chrome.com/extensions/api_index
What is the expected result? access to chrome object like extension background.js
What happens instead? chrome object in undefined
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
API reference - Chrome Developers
The complete reference to all APIs made available to Chrome Extensions. This includes APIs for the deprecated Chrome Apps platform as well as...
Read more >How do I access ALL window objects from a Chrome extension?
To gain access to everything available to the host window , I had to create a script element, put all the code I...
Read more >Chrome incompatibilities - Mozilla - MDN Web Docs
In Chrome: JavaScript APIs are accessed under the chrome namespace. (cf. Chrome bug 798169). Asynchronous APIs: In Firefox: Asynchronous APIs ...
Read more >chrome object or chrome.tabs object not accessible from script ...
am experimenting with the chrome extensions API and I ran into a problem which I don't understand,. I have a background script "background.js"...
Read more >Set Chrome app and extension policies (Windows)
Step 3: Get Chrome app or extension IDs · Open the Chrome Web Store. · Find and select the app or extension you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re trying to evaluate that piece of code in the context of the page, but
chrome.*
aren’t available in the context of the page due to how CRXs work.In the next release, you’ll be able to use
target.page()
to get abackground_page
Page object. From there, you can callpage.evaluate
and UI think your snippet should work.upcoming docs: https://pptr.dev/#?product=Puppeteer&version=master&show=api-targetpage
did you have any luck implementing this @s16h ? Or anyone else