google-chrome-extension

Activate extension via short cut key

妖精的绣舞 提交于 2019-12-14 03:48:36
问题 Is it possible to open/initiate a google chrome extension via a short cut key. For example I would like to assign a short cut of, lets say, CTRL + E to open my extension and initiate it. Has anyone done this before? 回答1: UPDATE (5/24/2013): You can use the new chrome.commands API, which provides built-in framework support for keyboard commands. Original answer follows: Step 1: Use a content script to bind a keypress listener to every page. // in the content script, listen for Crtl+Shift+E

How to send POST request from chrome extension (without clicking) to Flask when browser is reloading the page?

早过忘川 提交于 2019-12-14 03:44:38
问题 I want to merge the snippets below to be able to send post request (containing URL) from chrome extension to flask whenever the page in Chrome is loading without clicking the extension' icon. Is this possible? Moreover I would like the popup to be shown only on specific pages that I declare (I believe there is a way ('matches') for this in manifest.json however, I don't know how to implement this.) chrome.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) { var tab=tabs[0];

how to change sites contents Using Chrome Extension ? (Example) [closed]

余生颓废 提交于 2019-12-14 03:35:31
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I Need A Page Action Or Browse Action with Files That Change An element In A Website 回答1: take a look at this: http://code.google.com/chrome/extensions/content_scripts.html You can add javascript scripts and css

How to force a chrome extension autoupdate from the extension itself?

不打扰是莪最后的温柔 提交于 2019-12-14 03:25:17
问题 When we push a new version to our server, the old extensions deployed take some time (<7hours in the docs, but I have seen more) to update themselves. The problem is that these OLD extensions may talk to the NEW services/api deployed on the server, thus raising conflicts. And those are very hard to hunt down... Any advice? Thanks. 回答1: You can't force autoupdate but you can pass api version along with the server response and have extension notify users to upgrade if it is outdated (response

How to click on a button in Chrome Extension

China☆狼群 提交于 2019-12-14 03:24:57
问题 I am just trying to set up a simple chrome extension that will just click on an element once the extension button is clicked on. I have researched this a bit, and I can't find a simple answer that says how to click, everyone else has very elaborate code that I can't understand and don't know if it's necessary or not. What I mean is, whenever I search for just "click" I find a question that is much more advanced than my level. (I am about to make a lot of $ off of this extension, so please

Proxy in Chrome Extension

六眼飞鱼酱① 提交于 2019-12-14 03:16:13
问题 I want to create a Chrome Extension wich changes the Proxy Settings of Chrome. Everything works correct but the problem is that i have to authenticate with username and password with the proxy. Any idea how to do this ? var config = { mode: "fixed_servers", rules: { proxyForHttp: { scheme: "https", host: "209.164.75.72", port: 9786, username:'myusernmae', password:'proxypassword' }, bypassList: ["foobar.com"] } }; chrome.proxy.settings.set( {value: config, scope: 'regular'}, function() {

$scope.$apply doesn't do anything in a Chrome extension popup

旧街凉风 提交于 2019-12-14 02:53:37
问题 I'm writing a chrome extension that consists of a background process and a popup. The background process continually makes ajax requests to get new data, and the popup displays the info. In an extremely simplified way, the background.js process looks like this: var Background = { data: {}, poll: function() { $.ajax({ url: 'some_url', success: function(data) { this.data = data; chrome.extension.sendMessage('update'); }.bind(this) }); }, startPolling: function() { setInterval(this.poll.bind

Chrome Extension to change text style of specific website

你说的曾经没有我的故事 提交于 2019-12-14 02:52:44
问题 So, I'm trying to make a chrome extension for this website www.twitch.tv, it has a chat and I'm trying to change the color of my name in it. See images below. From (left), to (right): I have my manifest.json file with a content_script. So I want to change my name "nickeaules" on that specific site to another color, and I have no idea to begin with this as I have never made a Chrome extension before. Is this possible with some simple code? Or is it way to complex to code? 回答1: You can use

Chrome Extension: Unable to pass message to content.js

ぃ、小莉子 提交于 2019-12-14 02:52:16
问题 I am trying to send a message from background.js to content.js. addListener in content.js is not working. background.js chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { console.log(tab.url); if(changeInfo.status=="complete"){ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { if(tabs.length!=0){ chrome.tabs.sendMessage(tabs[0].id, {message: "sendurl"}, function(response) { console.log(response.url); }); } }); console.log("load complete"); } }); content

How to add automatic click feature in chrome extension?

被刻印的时光 ゝ 提交于 2019-12-14 02:23:07
问题 I am creating a chrome extension, and need to click on the first link automatically for some time. Is it possible to add automatic click feature in chrome extension?? 回答1: If you don't care about mouse coordinates, you can use this: var trigger = document.createEvent("Event"); trigger.initEvent("click", true, true); element.dispatchEvent(trigger); "element" should be the DOM node you want to trigger the click on. If you want to also specify a particular X/Y coordinate, you could use this: var