google-chrome-extension

How do I use `jpm` with webextension in Firefox?

二次信任 提交于 2020-01-13 03:15:12
问题 I'm starting a Firefox addon and from what I see: jpm is the tool to manage a Firefox addon ; WebExtensions are a new way to write Firefox extensions compatible with the extension API supported by Google Chrome and Opera ; yet I can't find if jpm is usable with WebExtensions. Question Is it possible to develop a WebExtensions using jpm ? 回答1: Nope. They’re two separate ways of developing Firefox add-ons. Just to add a little more detail, if you’re writing an add-on you want people to use now,

Is it possible to audit multiple pages with Chrome Developer tools?

隐身守侯 提交于 2020-01-12 18:51:16
问题 I am trying to find out unused CSS class in my website, and then I found that there is a audit function in Chrome developer tools that will mark unused CSS classes. However, it is only doing one page at a time. Is there a way to make it audit multiple pages so that I can find out CSS classes that are not used in all pages? I know there is a Firefox plugin Dust-Me that do the job. I am asking just to find if I can do that with Chrome alone, as I am more familiar with Chrome Developer tools.

Is it possible to audit multiple pages with Chrome Developer tools?

安稳与你 提交于 2020-01-12 18:50:34
问题 I am trying to find out unused CSS class in my website, and then I found that there is a audit function in Chrome developer tools that will mark unused CSS classes. However, it is only doing one page at a time. Is there a way to make it audit multiple pages so that I can find out CSS classes that are not used in all pages? I know there is a Firefox plugin Dust-Me that do the job. I am asking just to find if I can do that with Chrome alone, as I am more familiar with Chrome Developer tools.

Getting “Could not establish connection. Receiving end does not exist.” when content script sendResponse to background

笑着哭i 提交于 2020-01-12 14:04:23
问题 I wrote a chrome extension, popup js will send a message to background and background will redirect the message to content script, after some network request, the result should be returned to the background and then popup js. Below are some simplified pieces of my code. popup js $('.porintButton').click(function() { switch (this.id) { case 'learningPointButton': chrome.runtime.sendMessage({ action: 'learning' }, callback); processResult(); break; } return true; }); backgound js chrome.runtime

speedtest.net api

元气小坏坏 提交于 2020-01-12 13:51:34
问题 I want to make a widget to display the user's most recent speed test results. Does speedtest.net have an api I could use? I tried making an ajax request to http://speedtest.net/csv.php?csv=1&ria=0&s=0 but got a cross domain error. I tried an iframe, but that just made it appear in downloads. This is going to be in a Google Chrome extension so I can use the chrome api if necessary. 回答1: speedtest.net is run by Ookla and their Speed Test application. Unfortunately they don't provide any public

How can I run this script when the tab reloads (chrome extension)?

自古美人都是妖i 提交于 2020-01-12 07:53:17
问题 So i'd like to run a script when the tab reloads in a specified URL. It almost works, but actually id doesn't :) This is my manifest file: { "manifest_version": 2, "name": "Sample Extension", "description": "Sample Chrome Extension", "version": "1.0", "content_scripts": [ { "matches": ["http://translate.google.hu/*"], "js": ["run.js"] } ], "permissions": [ "activeTab", "tabs" ], "browser_action": { "default_title": "Sample", "default_icon": "icon.png" } } and this is run.js: chrome.tabs

chrome.storage.sync vs chrome.storage.local

扶醉桌前 提交于 2020-01-12 07:24:08
问题 I was trying to understand how to use the chrome.storage.api. I have included the following in my manifest.json : "permissions": [ "activeTab","storage" ], Than, I opened a new tab with the devtools and switched the <page context> to the one of my chrome-extension. Than I typed: chrome.storage.sync.set({"foo":"bar"},function(){ console.log("saved ok"); } ); and got: undefined saved ok Than I tried getting this stored value: chrome.storage.sync.get("foo",function(data){ console.log(data); } );

Adding NaCl in an Chrome Extension

谁说我不能喝 提交于 2020-01-12 04:32:06
问题 My question is quite simple, I tried to create a chrome extension that calls a NaCl module. My button and different files seem to be ok, and my quite simple code in C++ returns a PostMessage hello World. But, when I try it, it doesn't work. Are there specific things that I haven't done for including a NaCl module in a Chrome extension? I must say that I'm a little bit losing hope. Here is my "background.html": <body> <script src="background.js"></script> <div id="listener"> <embed name="nacl

Desktop notifications from content scripts

血红的双手。 提交于 2020-01-12 02:08:20
问题 I am trying to show a simple desktop notification code from a content script, but it doesn't seem to work.. I have added the permissions in the maifest.json file. Is there a restriction on showing them from the content script ? 回答1: Yes, notifications use Chrome specific API, and the content script is only valid for general javascript etc... The background page is where all chrome specific API's are capable of running... First you'll need to register your background page in the manifest.json

chrome extension use the same socket.io connection under background page and content scripts

假如想象 提交于 2020-01-11 19:58:50
问题 I'm doing a chrome extension with socket.io , i have a content script that keep connecting to server to make a real-time chat, but i also want to get some information from server in background page. it works well separately like this in content script var socket = io.connect('http://localhost:3700'); socket.on('dosomething',function(){ console.log("test"); }); in background page var socket = io.connect('http://localhost:3700'); socket.on('dosomething',function(){ console.log("test"); }); but