google-chrome-extension

Why is chrome.browserAction.onClicked undefined?

北城余情 提交于 2021-01-29 05:25:50
问题 I'm writing a Chrome extension that will redirect me to a URL when clicking on the browser action icon. I'm trying to use: chrome.browserAction.onClicked.addListener but I get Uncaught TypeError: Cannot read property 'onClicked' of undefined This is my manifest file: { "name": "first extension", "version": "2.2.12", "description": "redirct to a link icon", "browser_action": { "default_icon": "icontest.png", "default_title": "Do action" }, "permissions": ["tabs", "http://*/*"], "content

“Not allowed to load local resource” error is seen while launching the chrome crash url

◇◆丶佛笑我妖孽 提交于 2021-01-29 05:12:26
问题 I want to crash the chrome url in a separate window for my application testing purpose, But the below piece of code gives me 'Not allowed to load local resource' error. Is there any way I can launch the chrome crash url through window.open without receiving the error ? Here is what I tried : <html> <head> <title>Sample Test</title> <script type="text/javascript"> function crashTest() { window.open("chrome://inducebrowsercrashforrealz", "windowInMyApp", "left=50, top=100, width=600, height=400

CSS Filter not working on body in Chrome & Firefox

坚强是说给别人听的谎言 提交于 2021-01-29 04:50:53
问题 I want to create a chrome extension that does some filtering for color blindness testing and wanted to use css/svg filters but have a problem with filters not affecting body background. Any suggestions? Link to codepen (test in Chrome) or see screenshots below: http://codepen.io/larsenwork/pen/oZvdzX/?editors=1100 html { filter: grayscale(100%); } body, div { background-color: cyan; } /* Codepen style (ignore) */ * { margin: 0; padding: 0; box-sizing: border-box; } body { min-height: 100vh;

Chrome Extension: Edit the current url on click and then redirect to the edited one

走远了吗. 提交于 2021-01-28 22:22:26
问题 I am a psychology student and I read papers very often. The university libraries provide the access to the databases but I need to use library search engine and log in every time. Quite annoying. I found a way to avoid jumping around the pages. Here is the method: I add "ezp.lib.unimelb.edu.au" to the end of the target database address after I found a paper in Google Scholar, then it will redirect to the library login page. For example, the paper's address is: http://www.sciencedirect.com

Chrome Extension: How do I get a web page to access functions defined by my content script?

南笙酒味 提交于 2021-01-28 21:58:04
问题 I'm programming a Chrome Extension, and I'm having it inject a content script which iterates through a few elements and attaches an onclick property to them which sends a message to my background script to execute a custom function on the DOM (the function defined in content scripts). To send a message from the web page to the extension, I must specify the extension ID which, as of now, I was manually getting from the extensions menu. Could I manage to query something for the extension's own

Chrome Extension: How do I get a web page to access functions defined by my content script?

夙愿已清 提交于 2021-01-28 21:39:00
问题 I'm programming a Chrome Extension, and I'm having it inject a content script which iterates through a few elements and attaches an onclick property to them which sends a message to my background script to execute a custom function on the DOM (the function defined in content scripts). To send a message from the web page to the extension, I must specify the extension ID which, as of now, I was manually getting from the extensions menu. Could I manage to query something for the extension's own

Chrome extension - Can I share my extension as crx file for using someone?

旧街凉风 提交于 2021-01-28 11:01:45
问题 I publish my extension in google web store and install it successfully in my chrome. So I find extension's files in this directory: C:\Users\User_Name\AppData\Local\Google\Chrome\User Data\Default\Extensions. I use my extension for native messaging in chrome. How do I get .crx file for publish my extension for other people without internet connections? Or exactly like firefox *.xpi files. Also: If I pack extension's files in above DIR to zip and rename to crx file, and drop down to chrome

Google Analytics in Chrome Extension not working

老子叫甜甜 提交于 2021-01-28 10:29:55
问题 I have created an account on Google analytics, created a property, and a data stream for web. In my popup.js for the Chrome extension I have the following code: // Standard Google Universal Analytics code (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google

get request and response body from Chrome API onCompleted method

非 Y 不嫁゛ 提交于 2021-01-28 08:40:04
问题 How to record request and response body, chrome API onCompleted method is giving to record response header. How to do without opening developer tool? I am developing a Chrome extension where I should capture total request and response. Currently, for the response, I'm able to capture response headers alone, is there a way to capture the entire response body? I have looked all the Chrome APIs and include onComplete method it is giving the option to capture response header only. Also, I want to