google-chrome-extension

How to detect extension on a browser?

醉酒当歌 提交于 2019-12-18 09:26:05
问题 I'm trying to detect if an extension is installed on a user's browser. I tried this: var detect = function(base, if_installed, if_not_installed) { var s = document.createElement('script'); s.onerror = if_not_installed; s.onload = if_installed; document.body.appendChild(s); s.src = base + '/manifest.json'; } detect('chrome-extension://' + addon_id_youre_after, function() {alert('boom!');}); If the browser has the extension installed I will get an error like: Resources must be listed in the web

Chrome Extension Trigger Keydown JS

▼魔方 西西 提交于 2019-12-18 09:24:36
问题 I am writing a Chrome extension which needs to be able to trigger keydown events at the document level of the target page. The target page has an event listener which uses javascript like: document.addEventListener("keydown", function (event) {…}); My manifest.json is as follows: { "manifest_version": 2, "name": "Title", "version": "1.0", "description": "Testing", "icons": { "default_icon": "icon.png" }, "browser_action": { "default_title": "Title" }, "author": "James McLaughlin", "background

XMLHttpRequest succeeds without manifest permissions? Maybe CORS?

放肆的年华 提交于 2019-12-18 09:17:55
问题 I have developed a Google Chrome extensions that uses YouTube Data API v2 . My permission field in the manifest looks like this, because the script is injected in pages under youtube.com and I also need access to tabs: "permissions": ["tabs", "*://*.youtube.com/*"] This also works when I do a request to YouTube Data API v2 because the request is done to http://gdata.youtube.com/, so it is the same domain. But now I am migrating to YouTube Data API v3 , and the requests must be done to http:/

As of Chrome 53, how to add text as if a trusted textInput event was dispatched?

时光怂恿深爱的人放手 提交于 2019-12-18 09:17:22
问题 As of Chrome 53, untrusted events no longer invoke the default action. https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted Before Chrome 53, this JavaScript would add an interrobang, ‽. var e = document.createEvent('TextEvent'); e.initTextEvent('textInput', true, true, null, String.fromCharCode( 8253 )); document.activeElement.dispatchEvent(e); In Chrome 53, see what happens: https://jsfiddle.net/dblume/2nfhrj1j/10/ Since the event made with createEvent() is untrusted, it doesn't

Chrome extension in app purchase always returns PURCHASE_CANCELED, even if the purchase worked

喜欢而已 提交于 2019-12-18 08:25:24
问题 This question is related to the one at Chrome Webstore Extension In App Purchase INTERNAL_SERVER_ERROR. I first posted my question there in the form of a comment, but received feedback that this was more appropriate as a separate question. Like the OP, I am using buy.js and following the recommended workflow for in-app purchases in the Chrome extension. But my results are somewhat different: when I complete the IAP buy dialog, I get back a PURCHASE_CANCELED, even though I bought the IAP. If I

Chrome extension in app purchase always returns PURCHASE_CANCELED, even if the purchase worked

谁说我不能喝 提交于 2019-12-18 08:25:23
问题 This question is related to the one at Chrome Webstore Extension In App Purchase INTERNAL_SERVER_ERROR. I first posted my question there in the form of a comment, but received feedback that this was more appropriate as a separate question. Like the OP, I am using buy.js and following the recommended workflow for in-app purchases in the Chrome extension. But my results are somewhat different: when I complete the IAP buy dialog, I get back a PURCHASE_CANCELED, even though I bought the IAP. If I

chrome extension unable to load external javascript from google using content scripts and other ways

好久不见. 提交于 2019-12-18 08:24:21
问题 I am writing a chrome extension which will enable transliteration for specific textboxes in facebook. I have used the script tab to load https://www.google.com/jsapi in background.html here is the code i have used in a content script i tried to load using ajax and the generic way. when i checked it said google undefined. /* $.ajax({ url: "https://www.google.com/jsapi", dataType: "script", }); */ var script = document.createElement("script"); script.setAttribute('type','text/javascript');

Chrome extension, making a link from key words in the body

佐手、 提交于 2019-12-18 07:25:52
问题 So that you understand my knowledge base, I am a computer engineering major, and am working a job right now at a medical company over the summer. I have little (almost zero web code experience) but that is mostly what my job wants me to do so I have been trying to figure it all out as fast as I can. I have used a lot of C, and Verilog and C++ in School, so computer "languages" are not new but I am having a hard time figuring this stuff all out. Anyway, my first assignment has been to build an

Chrome extension, making a link from key words in the body

£可爱£侵袭症+ 提交于 2019-12-18 07:25:19
问题 So that you understand my knowledge base, I am a computer engineering major, and am working a job right now at a medical company over the summer. I have little (almost zero web code experience) but that is mostly what my job wants me to do so I have been trying to figure it all out as fast as I can. I have used a lot of C, and Verilog and C++ in School, so computer "languages" are not new but I am having a hard time figuring this stuff all out. Anyway, my first assignment has been to build an

Chrome WebExtension - Private Store and Enterprise Environment

两盒软妹~` 提交于 2019-12-18 07:25:06
问题 I'm trying to publish a Chrome Extension in a Private Store and to propagate it with a Group Policy. In order to do that I'm using the following references: CRX Packaging GPO Propagation I'm 100% sure that the GPO is configured correctly (if I use the same GPO to propagate an extension published on the Chrome WebStore it works). Unfortunately, both my private extension (line in the Configure the list of force-installed apps and extension section: [my_extension_id];[my_xml_url] ) and the