google-chrome-extension

Chrome Extention Port error: Could not establish connection. Receiving end does not exist

大兔子大兔子 提交于 2019-12-23 21:37:24
问题 I am getting this error when trying to send a message from popup to my contentscript. What I am trying to do is get the document of the current tab from my content.js and send it to the popup. How can I fix this erro? { "manifest_version": 2, "name": "Chrome Snapshot", "description": "Save images and screenshots of sites to Dropbox.", "version": "1.0", "permissions": [ "<all_urls>", "tabs" ], "browser_action": { "default_icon": "icon.png", "default_popup": "html/popup.html" }, "background": {

Possible to have multiple content scripts for different functions?

久未见 提交于 2019-12-23 20:40:52
问题 I am new to this, but I am trying to create a chrome extension to manipulate DOMs on the webpage. Currently, I have two buttons and each button will do different tasks. Does the following make sense? Also if I have multiple content scripts, how can I add them both into the manifest.json popup.js: function injectTheScript() { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { // query the active tab, which will be only one tab //and inject the script in it chrome.tabs

YouTube Data API v3 allowed referers for browser app key not working as expected

孤人 提交于 2019-12-23 20:22:15
问题 I am struggling trying to configure the new YouTube Data API v3 correctly. I need to access the API from a Google Chrome extension. I already created an API key from Google APIs Console, more precisely a Key for browser apps (with referers) key. Having the allowed referers set to blank, all the referers are allowed and everything works ok. However, this key is embedded on my Chrome extension and therefore public to everybody. Anyone could use my key to make requests, polluting my stats and

Chrome: Uncaught ReferenceError jQuery is not defined

别等时光非礼了梦想. 提交于 2019-12-23 19:04:55
问题 I am trying to build a chrome extension. It takes the username's background picture url and puts it to the page. But it gives unexpected error. The error text is: The page at https://twitter.com/jack ran insecure content from http://api.twitter.com/1/users/show.json?screen_name=jack&callback=jQuery18207089675806928426_1351333462593&_=1351333462594. Uncaught ReferenceError: jQuery18207089675806928426_1351333462593 is not defined (anonymous function) The extension folder contains these files:

Chrome extension action on shutdown

陌路散爱 提交于 2019-12-23 18:31:09
问题 I'm writing a very simple Chrome extension to automatically clear my history as this isn't a built in feature. I've got it functional but just want to confirm I've done things that make sense before I wrap it up. First - is there a reason to do a chrome.history.deleteAll? This doesn't actually appear to interface with URL browsing history, instead you need to use chrome.browsingData.* for that. Should I do the former anyway? Next - after searching and searching, there appears to be no way to

How to insert HTML/JS into window (of type “panel”) created by chrome.windows.create?

痴心易碎 提交于 2019-12-23 18:11:48
问题 I'm creating a window in a Chrome Extension using chrome.windows.create . It's of type panel , so it's not a regular browser window or tab, but a free-standing window floating above all others. Having created it, I now need to insert some HTML and JavaScript into it. So how is that done? There's a Window Object returned from create, but it has no useful hooks in it - just a few attributes. Nothing in the documentation suggests how to do that, and I don't see and DOM tree fo it anywhere. Any

How to listen to history events like “go back”, “go next” in Chrome extension?

£可爱£侵袭症+ 提交于 2019-12-23 18:01:31
问题 For now, I've only found a way to listen to "reload" event using: chrome.webNavigation.onCommitted.addListener(function(details) { if (details.frameId == 0) { if (details.transitionType == "reload") { // do something } } }); What about "go back" and "go next" events? I'm looking for a Firefox's nsISHistoryListener alternative in Chrome. Edit : Submitted a feature request to Chromium. 回答1: You could use the window.beforeunload event to capture when a user intends to navigate to another page

implementing google oauth2 for chrome extension interecting with our servers

陌路散爱 提交于 2019-12-23 17:59:58
问题 What is desired : A chrome extension which uses google ooauth2.0 to log-in in extension, and sends data of his action safely to my servers with access token, where I get user details from the access token and save his actions, server implementation in php. What I have done : Registered Google API Access 'Client ID for web applications' with redirect Url http://www.google.com/robots.txt, as explained by http://smus.com/oauth2-chrome-extensions/. Based on same tutorial and their code I am

Using a Stripe credit card form in Google Chrome extension— unable to avoid “Payment not secure?”

无人久伴 提交于 2019-12-23 17:39:58
问题 I'm trying to get a simple Stripe credit card form inside the browser popup for a google chrome extension. However with the latest version of Chrome, the credit card form is always being accompanied with a message of "Payment not secure": Payment not secure I've read what the google chrome docs have to say about this message over here: https://developers.google.com/web/updates/2016/10/avoid-not-secure-warn And I think this is the relevant part: To ensure that the Not Secure warning is not

How force iFrame open all links stay in the iFrame?

大城市里の小女人 提交于 2019-12-23 17:26:10
问题 I'm hosting an iFrame and it seems like when a link points to external domains it loads it on the main window and not in the iFrame. Is there a way to force the links to be opened in the same iFrame? Notice: I can add anything I want to the page loaded in the iFrame (using Chrome extension). I tried adding: <base target="_parent" /> But it didn't do any good... 回答1: Check Headers of your external domain page. If X-Frame-Options Header is set to DENY , browser ignores loading content to iframe