google-chrome-extension

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

折月煮酒 提交于 2020-01-11 19:58:49
问题 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

How to add row to first empty row? Google spreadsheet API with chrome extensions

[亡魂溺海] 提交于 2020-01-11 14:33:24
问题 I successfully created a chrome extension that uses oAuth2 to write to a google spreadsheet. Now i have the problem that my code just adds my content to the first row and updates that row, whenever i call the function to add new content. How do i have to change my code to just add a new row whenever i call it but do not update just the first row over and over again?? This is my code: function addRowToSpreadsheet(params){ chrome.identity.getAuthToken({ 'interactive': true }, getToken);

Background.js Doesn't Find Content Injected with Content Script

爷,独闯天下 提交于 2020-01-11 14:18:28
问题 My Chrome extension has a Content-Script that injects a custom DIV into the current page. This part works. But then, the extension also has a right-click Context Menu, which when clicked, should modify this injected DIV in some way (let's say, add some text into that DIV). The issue is that the injected content isn't found. The right-click menu handler is in Background.js, and this file doesn't know anything about the content. manifest.js "content_scripts": [ { "matches": [ "http://*/*",

How do I manually install extensions on Chrome for OS X?

泪湿孤枕 提交于 2020-01-11 13:30:51
问题 i have create a chrome extension and i want to add it manually to chrome on mac osx (10.7 and 10.8) i tried to do the following steps add the extension folder under the following url: /Users/talmutzafi/Library/Application Support/Google/Chrome/Profile 20/Extensions/ add the extension data under the preferences list. the preferences list is located on /Users/talmutzafi/Library/Application Support/Google/Chrome/Profile 20/preferences i tried to add : - under backup i added the ext. id to the id

Random URL redirect from array

荒凉一梦 提交于 2020-01-11 12:53:22
问题 /** * Political Animals * contentscript.js is loaded on each page(s) listed in manifest.json * This plugin replaces all the images on the website of news sites with pictures of * animals in suits, as a commentary on what the news has become. Made for Web 2 * November 20, 2013 */ //Random Image array var arrayImg = ['http://www.whattofix.com/images/PoliticalAnimal.jpg','http://www.fubiz.net/wp-content/uploads/2013/03/Fashion-Zoo-Animals26.jpeg','http://img1.etsystatic.com/016/1/7647665/il

Chrome Webstore Extension In App Purchase INTERNAL_SERVER_ERROR

我们两清 提交于 2020-01-11 12:29:08
问题 Partial success with the Chrome InApp purchase flow within a Chrome extension. I have included the buy.js file and implemented the flow as listed on the Chrome walkthrough here: https://developer.chrome.com/webstore/payments-iap Using my live extension, I have run through the flow and it works just fine. My credit card is charged and the callback returns successful, I deliver the item. When I check the google.payments.inapp.getPurchases call I can see the item listed as ACTIVE. However, when

Google chrome - chrome.serial connection failed

那年仲夏 提交于 2020-01-11 11:38:49
问题 I am trying to connect to USB serial which is working manually as below: $ ls /dev/cu.* /dev/cu.Bluetooth-Incoming-Port /dev/cu.usbserial $ screen /dev/cu.usbserial 9600 But when Google chrome apps trying to connect its failing. apps, background.js: var DEVICE_PATH = '/dev/cu.usbserial'; var serial = chrome.serial; function log(msg) { console.log(msg); } var ab2str = function(buf) { var bufView = new Uint8Array(buf); var encodedString = String.fromCharCode.apply(null, bufView); return

Google chrome extensions: dispatchevent in main web page

懵懂的女人 提交于 2020-01-11 11:22:28
问题 I have in my extension content script. From content script I tried dispatch event at main web page. But event didn't dispatch, nothing. For greater certainty I dispatch events in all elements =) $('*').each(function(i, entity){ console.log(entity); $(entity).trigger('mouseenter'); }); From this article, I found that extension has limited scope and no access to main page script variables. But can I trigger elements event at main page from extension content script? Sorry for my bad english! 回答1

Unchecked runtime.lastError while running tabs.executeScript: Cannot access contents of url “data:text/html,chromewebdata”

瘦欲@ 提交于 2020-01-11 10:10:49
问题 I'm getting this error: extensions::lastError:133 Unchecked runtime.lastError while running tabs.executeScript: Cannot access contents of url "data:text/html,chromewebdata". Extension manifest must request permission to access this host. I'm getting this error after disabling internet so that I can take action when the page load fails(due to heavy load) or internet down. I've checked all similar questions and this almost similar but still unable to make it work. Another very similar one with

How do I make it so my Chrome extension will only inject a script once?

徘徊边缘 提交于 2020-01-11 09:29:09
问题 I'm using programmatic injection to inject my extension's code into a page only when the browser action is clicked. This is what I have on my extension's event page (per the example in the documentation): chrome.browserAction.onClicked.addListener(function callback(tab){ chrome.tabs.executeScript(null, {file: "content-script.js"}); }); However, the way this works, the script is injected every time the button is clicked. How can I change it so that the script is not injected on subsequent