Is there a way to open a Google Chrome plugin's options.html page via Javascript in background.html?
The idea is to compile Python to Javascript (technically a JS pre-compiler) using Rapydscript. Then include the generated script in the Chrome extension. The site above has a zip file with all the stuff inside. I recommend using Rapydscript instead of Pyjamas.
In browser action, you should include default_popup value which points to the HTML file to be rendered as popup. In your case it is userinfo. html. You should look into setPopup method and chrome.
Chrome plugins are created using HTML, JavaScript and CSS. We can use Python to create normal Chrome extensions using a Python to Javascript compiler (Rapydscript).
There is a new method that is enabled beginning with Chrome 42:
chrome.runtime.openOptionsPage(function callback)
Open your Extension's options page, if possible.
The precise behavior may depend on your manifest's
options_ui
oroptions_page
key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, withinchrome://extensions
, within an App, or it may just focus an open options page. It will never cause the caller page to reload.If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set
lastError
.
chrome.tabs.create({ url: "options.html" });
Update
Starting with version 40, Chrome now uses a new popup options dialog from the extension management page instead of dedicated options pages (which are being deprecated). You can still achieve the same effect with a modification to the URL.
chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With