Some Chrome APIs like chrome.tabCapture.capture require the extension to be invoked in order to work (i.e. user should click on the extension icon).
Is there a way to invoke the extension using Puppeteer (preferred) or in some other automated way?
You can pass the --whitelisted-extension-id=<extension-id> flag to Puppeteer.
Related
This is something like a chrome extension changes the elements of a web page dynamically.
I am wondering if i can change the DOM elements of a chrome app from another chrome app or extension.
If this is possible, how can I do that ?
========================================================
Example:
There is a standalone chrome app working on the desktop
There is another app / extension works like a chrome app debugging tool which can access the content of that standalone app
The answer can be no, since when you are saying the DOM elements of a chrome extension, I guess you mean the popup/options page for the extension, its url starts with chrome://extensions while content script can't access this kind of page.
The answer can also be yes, since if you have control on both of the extension, you can do Cross-extension messaging, in this way, to some degree you can achieve change the DOM of a chrome extension from another extension.
I am able to launch Chrome browser with extension in the browser. But I am not able to interact with the extension.
When I launch Chrome browser manually, I go to chrome://extensions and configure command for that extension and set short cut like "Alt+H" to launch the extension from short cut and after hitting Alt+H the extension gets invoked.
But when I launch chrome browser with extension using watir webdriver, the configure command setting for that extension is not set. After I set that manually again to "Alt+H" and try to invoke the extension on the browser which is launched using watir-webdriver, I don't see extension getting invoked.
Please let me know how can I interact with the chrome extension using watir-webdriver.
I do not think watir can interact with the extensions. It can only interact with the page. But, I could be wrong. I had moderate success with Sikuli when I needed to do something like that.
I want to be able to call functions that I am writing in a Chrome extension from the JS console in Chrome, so that I can test them easily and see how their output changes as the page changes.
But it seems as the functions I write aren't available to the chrome JS console. I don't really understand JS that well, or the chrome extension model, but I need to somehow inject the extension source into the body of the page that I am using the extension for?
If you are talking about functions that you defined in a background page, then you need to go to your extensions page, check the developer mode box, and click on _generated_background_page.html. That is where you will find your background page code.
If you mean functions in a content script, then when you are in the console, go down to where it says <page context> and change it to your extension. Then you will have access to the functions in the content script.
I am trying to develop a chrome extensions. I've developed a few firefox extensions a few years ago. In firefox it was possible to automatically run your extension of the page, and alter the page's content (add HTML and style it). I'd like the extension to automatically change the html, without requiring the user to click a button up in the browser's window.
How to get chrome to run extensions automatically?
Thank you
You just have to declare a content script in your manifest.json, it will be automatically executed on all pages matching the corresponding URL pattern without any user interaction.
I have Google Chrome and the extensions installed on it. I would like to reduce number of extension buttons on Chrome panel.
For this I want to create my plugin which will display popup window and allow to run another extension installed on my browser?
Is it possible and where I can find examples?
The messaging API has an external extension feature. You can use that communicate between extensions.