How to inject content scripts when the icon is clicked, without using onClicked.addListener() in the background page, because this will prevents the popup from showing up.
I want the popup to display and a content script to be injected simultaneously (to get the text highlighted in the page)
Related
I'm new to using Watir and have a problem. Within my browser page there is an option to add a note. This brings up a window within the browser which has the following id:
span id="ui-id-2" class="ui-dialog-title">Add Note</span
I can't work out how to use the controls within this window such as the 'Save' button as Watir doesn't seem to recognise either the window or the controls
So if I wanted to use same type of Save button within the main browser it would be fine; I'd just use browser.button(:id=> "Save").click.
Trying to use it within the popup though won't work as Watir can't recognise it within the popup. Any ideas appreciated!
When a user clicks on extension icon I need it to open a page that renders predefined HTML instead of a popup window with this HTML.
For popup window, I know that I need to use browser_action.default_popup in the manifest. What do I need to use for a page?
I want to dynamically generate some buttons on my chrome extension default_popup HTML page and I want on click to open a model in the middle of the screen NOT a new tab, I saw some other extensions having its options like this, and then display some info.
I think the only possibility isto get rid of the defalt_popup and inject all my scripts through the background page straight into the html page.
Intro
I have a chrome extension I am working on, that uses the background page to listen to the following window and tab events:
chrome.tabs.onActivated
chrome.tabs.onUpdated
chrome.windows.onFocusChanged
The background process basically retrieves the HTML source from each qualifying page the user visits, via a content script injection and messaging.
Once the message with the HTML source is received in the background page, it performs specific tests which may take anywhere from few to several of seconds, depending on the source size.
The Problem
I found that each time I click on the extension icon to open the popup.html view, it renders my background page again and runs the HTML collection and analysis. The issue is the popup view window doesn't open until the background has finished, which on certain pages may take 5-10 seconds.
I tried running the entire background page async with setTimeout(function(){..},0) which didn't work..
How can I solve this?
Is there a way that the popup page will not render the background again? This happens anyway when the user views the tab, so I don't need it?
If not, is there a way for the popup to display regardless of the background operation?
any other suggestions?
Thanks!
This question has a couple bits to it. Basically I want to make the context menu behave like a sidebar that pops out a box with html.
Get the height and location of a users context menu?
Open an interactable html view next to the menu without closing the menu?
Close both the menu and popout on off-click.
So a user can right click on the page,
and then click the contextMenu item to open a page that can hold html