I’m looking at the documentation page and I can’t figure out whats wrong in my code: the documentaion says : Note that ‘details.imageData = foo’ is equivalent to ‘details.imageData = {’19’: foo}’ so I’m extremely confused Answer Your code is basically a bi…
Tag: google-chrome
Using chrome extension apis in typescript
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…
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 acc…
Notification popup doesn’t appear in chrome
I am trying to do a gmail similar type desktop notification . I am facing the difficulty to change the notification permission in chrome. The permission always shows denied in console if i use window.Notification.permission. If i manually change the permission in google chrome settings -> privacy -> con…
Javascript window.print() in chrome, closing new window or tab instead of cancelling print leaves javascript blocked in parent window
In the application I work on, we have several different places a user can print from. In all these cases we are using the same workflow of opening a new window(or tab), writing whatever we need to print to the document of the new window, and then we call The issue I’m seeing is that in Chrome, if I clos…
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 wi…
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…
Run line of javascript code over multiple pages
I want to run a simple line of code: over multiple pages of the same website. I have a list of all those pages, I want to open the page, click those two elements and close the page over – 700 times. Can I possibly program chromium console to do that(taking into account loading times)? Answer You can use…
chrome.runtime is undefined when extension installed from chrome store
When i console.log(chrome) with google chrome browser i get certain properties but i find the ‘runtime’ property of chrome is not available. so chrome.runtime is undefined. and hence i am not able to use chrome.runtime.sendMessage for my extension How to resolve the above?? EDIT : my code is : EDI…
How can I listen to xhr response using chrome-extension?
I want execute a function when some a chrome window gets a XHR response. I don’t know what exactly this request is like, because of a codified param of this request, for example: api.xxx.com/rest?random=123 So I don’t think I could use or which both need specify the request details. Answer The lis…