I’m building a chrome extension written in TypeScript. I’m using WebStorm and I added the chrome-DefiniteltyTyped library in my project. However, when I write this in my typescript code : chrome.extension.getURL I got an error : cannot find name ‘chrome’. Because of this, my javascript file is not generated and I cannot use it in my extension. Do you guys
Tag: google-chrome-extension
Why doesn’t chrome.tabs.query() return the tab’s URL when called using RequireJS in a Chrome extension?
I have a simple Chrome extension that adds a browser action. When the extension’s popup is opened, it needs to access the current tab’s URL. Since it doesn’t need access to all the tabs, I just have the activeTab permission specified in the manifest: In theory, that should give the popup access to the active tab’s URL, but the URL
Can a Chrome extension’s content script guarantee that a DOM event was user-initiated?
I have an extension injecting HTML elements into pages and watching for click events on those elements. I want to be sure that any given click event came from a user action, rather than JS on the page creating and dispatching a click event. Is there a way of doing so? Answer You’re looking for event.isTrusted, which has not yet
Exchanging events between React components
I’m making a Chrome extension that inserts 2 different React extensions on to the page. I’d like to keep each of them in sync by sending the 2nd one an event with appropriate data when something else is selected in the first one. Is there a best practice when it comes to sending events to other components? I tried this
‘unsafe-eval’ on chrome extension
I am trying to run the following: Which should (in theory), on page load run the loadScript.js file…. the loadScript.js file is as follows, this should append a file to the running page, not to the background page as it is at the moment: I am still a newbie to Chrome Extensions and .js so excuse me if I have
Chrome extension – script loaded event?
Is it possible to get an event (or other way of knowing) when a specific script is loaded into a page? E.g. I have a page action that should perform action if jQuery is present and have finished loading. Answer I ended up listening for “DOMContentLoaded” and then perform required actions. Thanks for all input
window.localStorage vs chrome.storage.local
I’m developing a Chrome extension and I need to store some data and then get it in some point. I did investigation on available storages and came across to the following ones: window.localStorage and chrome.storage.local. So my question is, which one is the right choice to use in Chrome extensions: window.localStorage or chrome.storage.local? P.S. I’m using browser action to load
Avoid dynamically injecting the same script multiple times when using chrome.tabs.executeScript(…)
I’m building a Google Chrome extension. The basic setup is I have a Browser action button that injects jQuery and another bit of JavaScript into the active tab when it is clicked to do it’s thing. This is my first Chrome extension, but it seems like if the user clicks the button to take action a second time the scripts
Enable chrome extension without clicking
How to enable chrome extension without clicking it. I need to perform a certain function from my extension every time i reload a page(no clicking) is there a way to do it. My code which contains the on click method and Answer To include jQuery: Using only pure JavaScript you can do this with: only the code within that function
How to store a password as securely in Chrome Extension?
I’m writing an Chrome extension right now which autofills credentials similar to Chrome’s autofill (in which case Chrome’s autofill fails). Is there a secure way to store the username/password in localstorage (all client-side)? If I encrypt the password, won’t the key be locally stored as well effectively making the encryption useless? Effectively, I want the user’s credentials to be as