google-chrome-extension

How to disable same origin policy in Chrome extension?

柔情痞子 提交于 2019-12-19 04:09:20
问题 Maybe are there some settings to disable this in extension context. Since I'm developing an extension it should be my own responsibility to not shoot my own goal. It is very frustrating to fiddle with this security thing that is totally out of reason when developing browser extensions. I don't want to make whole browser insecure by disabling it globally. just for the scripts that are set in "content_scripts" section in manifest.json 回答1: Your manifest.json file should have the domain you're

Accessing the document of a cross domain iframe using an extension in Chrome 45.0.2454.101

独自空忆成欢 提交于 2019-12-19 04:04:14
问题 I am using a content script in a Chrome extension to access a document in a cross domain iframe, using this code: document.querySelector('iframe').contentWindow.document This worked fine until I upgraded to the latest version of Google Chrome (45.0.2454.101 64-bit), which reports the following security error when accessing the iframe: Uncaught SecurityError: Blocked a frame with origin "http://www.miercn.com" from accessing a frame with origin "http://pos.baidu.com". Protocols, domains, and

Chrome extension: sendMessage doesn't work

风流意气都作罢 提交于 2019-12-19 03:40:12
问题 I've already read the documentation from Google on 'message passing' a few times and have probably looked at over 10 other questions with the same problem and already tried quiet a few variations of most of their "solutions" and of what I have below... This is black magic, right? Either way, here it goes. Manifest File: { "manifest_version" : 2, "name" : "Message Test", "version" : "1.0", "browser_action": { "default_popup": "popup.html" }, "background": { "scripts": ["background.js"] },

How to add event listener for checkbox in Chrome extension's popup?

我的未来我决定 提交于 2019-12-18 18:57:53
问题 I'm trying to capture changes of checkbox in popup of my Chrome Extension. Documentation says: Inline JavaScript will not be executed There is an example provided on the same page, but it for button . I don't know how to modify it so it would capture chekbox's state changes. document.addEventListener('DOMContentLoaded', function () { document.querySelector('button').addEventListener('click', clickHandler); }); 回答1: Had the same problem but reference a very helpful site which list events in

How to add event listener for checkbox in Chrome extension's popup?

隐身守侯 提交于 2019-12-18 18:57:50
问题 I'm trying to capture changes of checkbox in popup of my Chrome Extension. Documentation says: Inline JavaScript will not be executed There is an example provided on the same page, but it for button . I don't know how to modify it so it would capture chekbox's state changes. document.addEventListener('DOMContentLoaded', function () { document.querySelector('button').addEventListener('click', clickHandler); }); 回答1: Had the same problem but reference a very helpful site which list events in

How to add event listener for checkbox in Chrome extension's popup?

时间秒杀一切 提交于 2019-12-18 18:57:10
问题 I'm trying to capture changes of checkbox in popup of my Chrome Extension. Documentation says: Inline JavaScript will not be executed There is an example provided on the same page, but it for button . I don't know how to modify it so it would capture chekbox's state changes. document.addEventListener('DOMContentLoaded', function () { document.querySelector('button').addEventListener('click', clickHandler); }); 回答1: Had the same problem but reference a very helpful site which list events in

“No 'Access-Control-Allow-Origin' header is present on the requested resource.”

China☆狼群 提交于 2019-12-18 18:54:02
问题 I already tried looking for various questions, but that didn't help/I am too inexperienced to understand, so I have to be specific. This is what I get in the console: XMLHttpRequest cannot load https://a.websight.com/file/hex.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://asdfghetcetcetc' is therefore not allowed access. (index):1 It's breaking my entire extension and I don't know how to fix it. I would appreciate any help. 回答1:

Communicate between isolated worlds (extension js and webpage js) on chrome extension

对着背影说爱祢 提交于 2019-12-18 18:39:23
问题 As you may know, js files on chrome extensions and pages cannot directly access each other and they run on isolated worlds. However, I want to access some of the functions on a page and call those functions from the plugin. And I do not want to make my own version of those functions. I'm wondering if this is possible... Would appreciate all the answers. EDIT : The functions are on the background page. Its a browser action extension. more info: Basically, I have a context menu which creates a

Invoking a Google Chrome extension from Javascript

感情迁移 提交于 2019-12-18 17:28:36
问题 There is an excellent extension called Blipshot which takes page screenshots. I need to invoke the extension with page level javascript, instead of clicking its icon. Is this possible? 回答1: You cannot invoke any methods of an extension from within a web page. However, it's possible to inject a content script into the web page, and use sendMessage and onMessage , or onConnect and connect . To edit an extension: Visit chrome://extensions page, and enable the Developer mode. Unpack an extension

API call for user count in Chrome Web Store? [closed]

大兔子大兔子 提交于 2019-12-18 16:30:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I have an extension in the Chrome Web Store and I like knowing roughly how many people are using it via the "N users" and ratings on its page. However, I don't really like loading the whole "product" page just to see a couple of numbers and thought I'd try to make a little widget that would display it instead.