google-chrome-extension

Is it possible to determine a tab's opener within a Google Chrome extension?

烂漫一生 提交于 2019-12-18 13:28:26
问题 I am looking for a way to determine a given tab's opener (parent tab) within a Google Chrome extension. I've looked at the documention for Tab but there doesn't really seem to be anything that would yield this information. http://code.google.com/chrome/extensions/tabs.html I've tried injecting this content script into pages (thinking I could pass the value to my background page): alert(window.opener); .. but it just yields null. The best thing I've come up with so far is to keep track of the

Chrome Extension | How to include library in content and background scripts from cdn

自作多情 提交于 2019-12-18 13:27:51
问题 my Chrome extension has two files: content and background scripts. I need to add jQuery to content script from cdn and lodash to background script from cdn too. In my manifest I tried to add lodash from cdn like this: "background": { "scripts": ["background.js", "https://cdn.jsdelivr.net/lodash/4.13.1/lodash.min.js"] }, "content_security_policy": "script-src 'self' https://cdn.jsdelivr.net; object-src 'self'" But that didn't help. My content file is injected to the page from the background

Chrome extension: load and execute external script

我的未来我决定 提交于 2019-12-18 13:21:37
问题 I have trouble loading and executing external js-script into my chrome extension. Looks the same as this question, but I still cant't figure out why it doesn't work in my case. The idea is that I want to have in my content script some default function which should parse a web-page content. And for some specific web-pages I want to load and use specific parsers, so I try to load proper js-script for a wep-page, and this script shoud extend functionality of default parser. By now I try only

How to detect Chrome extension uninstall

僤鯓⒐⒋嵵緔 提交于 2019-12-18 13:19:59
问题 I am trying to detect whether my extension was uninstalled. I can't use chrome.management.onUninstalled because it will be fired on other extension. 回答1: Google Chrome, unlike Firefox, doesn’t allow to detect when the user uninstalls the extension, which is quite useful to understand user behaviour. There is a feature request on crbug.com with a discussion of this feature but it has not been implemented yet. 回答2: As of Chrome 41, you can now open a URL when the extension is uninstalled. That

Chrome extension update - Chrome Web Store system error

纵然是瞬间 提交于 2019-12-18 13:03:17
问题 When i upload an update to my extension on chrome developer dashboard, it is unable to do so and it shows, An error occurred: Failed to process your item. Chrome Web Store system error, please try again later. I updated the extension version in the manifest from 0.103 to 0.104, the manifest version is unchanged (2). As i made a change that did not require any extra permission, i did not make any further changes to manifest.json. The only file changed is plugin-min.js I tested it locally on my

Error in Chrome DevTools

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 12:54:47
问题 I have recently started to see a frequent error in Chrome Dev Tools when right clicking on an element for the purposes of selecting "Inspect Element" - instead of selecting the element on the " Elements" tab the error "Uncaught Error: Parameter 2 (message) is required. " appears in the "Sources" tab for a virtual "extensions:: schemaUtils" script. The error occurs in the function "validate" as per the screenshot below. This error seems to occur since installing the "OneTab" extension, and

How to transfer data between the content scripts of two different tabs?

自闭症网瘾萝莉.ら 提交于 2019-12-18 12:47:17
问题 In my extension I need to transfer some data from one tab's content script to another tab's content script. How can I choose certain tab using chrome.tabs, if I know a part of that tab object's name or url in it? How can two tabs' scripts communicate? UPDATE: Apparently I don't have method sendMessage in chrome.extension. When I run the following from content script: chrome.extension.sendMessage("message"); I get in console: Uncaught TypeError: Object # has no method 'sendMessage' 回答1: First,

Canvas has been tainted by cross-origin data via local chrome:// extension URL

女生的网名这么多〃 提交于 2019-12-18 12:42:05
问题 I am working on a google chrome extension and I am trying to load an image that is bundled with the extension into a canvas. var canvas = document.createElement('canvas'); canvas.width = 470; canvas.height = 470; var context = canvas.getContext('2d'); var image = new Image(); image.addEventListener('load', function(){ //process }); image.src = chrome.extension.getURL("asset/gotcha.png"); When I execute the code in a content script I am getting: Unable to get image data from canvas because the

How to generate a file for download in a Google Chrome Extension?

旧街凉风 提交于 2019-12-18 12:35:41
问题 I want to generate a CSV file as the result of some user interactions and then prompt the user to download it. How can I do that? I don't think it's possible in straight JS, but perhaps Chrome gives me some elevated privileges? 回答1: You can now use HTML5 File API to download a file. It is still in development, but you can use a BlobBuilder and redirect your use to download that file: var bb = new BlobBuilder(); bb.append(csvContents); var blob = bb.getBlob(); location.href = window.webkitURL

ACE Editor Autocomplete - custom strings

笑着哭i 提交于 2019-12-18 12:22:30
问题 I'm using ACE Editor within a Chrome extension. I'm using ACE's Autocomplete feature but I want to be able to completely define a list of static strings to use for the autocomplete, instead of any local strings or snippets. (In the future I might be using something more sophisticated than a static list, but for now static is fine.) Can anyone provide some instruction on how to accomplish this? I already have autocomplete enabled and snippets off, but I'm having trouble defining a static list