google-chrome-extension

How to set Content Security Policy in Chrome Extension Manifest.json in order for Firebase to work

旧街凉风 提交于 2019-12-22 11:09:07
问题 I made a Chrome Extension and used Firebase to collect data into a database. It worked fine for some time, but it seems there were some changes to Chrome. Now I get the following error in the javascript console when using Inspect Element on my Extension: Refused to load the script 'https://(myID).firebaseio.com/(otherprivatedata)' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:". This script is written at firebase.js:171, it's

How can I use chrome.downloads.onDeterminingFilename to change downloaded file names if the files have extension of jpg or png?

て烟熏妆下的殇ゞ 提交于 2019-12-22 11:05:17
问题 How can I use chrome.downloads.onDeterminingFilename to change downloaded file names if the files have extension of JPG or PNG? I am looking at the example here: chrome.downloads.onDeterminingFilename.addListener(function(item, __suggest) { function suggest(filename, conflictAction) { __suggest({filename: filename, conflictAction: conflictAction, conflict_action: conflictAction}); } var rules = localStorage.rules; try { rules = JSON.parse(rules); } catch (e) { localStorage.rules = JSON

Make Chrome Extension Popup Window Transparent

ε祈祈猫儿з 提交于 2019-12-22 10:55:56
问题 I am writing a chrome extension. I am wondering if there is a way to make the popup window transparent, that is the user can see the content of the current page even the popup window covers it. Thank you! 回答1: An interesting idea came to me mind yesterday, though you can't remove the white background, you can still mimic a transparent background. This will be done by taking a screenshot of the page right before opening the popup and place it as a background image of the popup. I'm not sure

Unable to call JavaScript function in html on button click

隐身守侯 提交于 2019-12-22 10:45:07
问题 I was making a Chrome extension, for which I have an html file, a JavaScript file which opens a modified link in a new tab, the manifest file and the icon. It works fine but now I want the javascript function to work only when the user clicks a button. So I made a button in the html file, put the js code inside a function and called the function using onclick . But for some reason, it is not working. On clicking the button nothing seems to happen. I have tried reloading the extension. Also, I

Is possible convert “ArrayBuffer” to some “readable” format like JSON? - Chrome extension

牧云@^-^@ 提交于 2019-12-22 10:44:42
问题 Is possible to convert "ArrayBuffer" to some "readable" format like JSON? Test script: <script> try { http = new ActiveXObject("Microsoft.XMLHTTP"); // Trying IE } catch(e) // Failed, use standard object { http = new XMLHttpRequest(); } var url = "http://localhost/test.htm"; var params = "param=abc&param2=62"; http.open("POST", url, true); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 && http.status == 200) { alert('send..'); } } http

Referer security when requesting a Simple API Access Key

て烟熏妆下的殇ゞ 提交于 2019-12-22 10:17:19
问题 I'm working inside of a Google Chrome extension. Extensions do not send out a "Referer" header when issuing requests, but it is possible to (potentially) modify this behavior by using chrome.webRequest.onBeforeSendHeaders. I am attempting to communicate with Google's YouTube V3 API. To do so, I must provide an API key. A successful request to their server looks like: $.ajax({ url: 'https://www.googleapis.com/youtube/v3/playlists?part=snippet&id=ALYL4kY05133rTMhTulSaXKj_Y6el9q0JH&key

Chrome Extension captureStream

吃可爱长大的小学妹 提交于 2019-12-22 10:09:31
问题 I'm developing chrome extension which makes the following: get access to the stream obtained from chrome.tabCapture.capture (when capturing video, let's ignore for now audio capture since it's not relevant to the issue I'm facing) pass this tabStream to URL.createObjectURL(tabStream) use the resulting url as a src for DOM Video Element videoEl.src = URL.createObjectURL(tabStream) invoke videoEl.play() and when the canplay event is called pass the videoEl as an argument to canvas's context

Background script only for specific domain in Chrome extension

被刻印的时光 ゝ 提交于 2019-12-22 10:00:07
问题 I would like to know how to run the background script of a Chrome extension for only specific/specified domain/s please? For example, if an extension is meant to run only on pages of Google.com, so there is no reason to keep the background script running on any other domains. In my manifest file I have set "matches" but I can still see the background script running on every domain and tab. ... "background": { "matches": [ "*://*.google.com/*" ], "scripts": ["scripts/background.js"],

What is causing an “Error connecting to native app” when connecting to a native host application with connectNative() in a Chrome extension?

时光怂恿深爱的人放手 提交于 2019-12-22 09:51:46
问题 I am implementing communication between a web page and a Mac application using Chrome's Native Messaging feature. All seems to go well until I make the javascript call to chrome.runtime.connectNative("my_native_host_app_name"), which produces the following error in the console: Error in event handler for runtime.onMessageExternal: Error connecting to native app: com.allinlearning.nmhforbrowserextension Stack trace: Error: Error connecting to native app: com.allinlearning

How to know when google searches?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 09:28:42
问题 I'm developing a chrome extension and I need to know when is google searching to perform an action on each search. I've tried to listen the requests with chrome.webRequest but the cached requests aren't captured. Evernote extension searches in my notes each time I search in Google, even if the request is cached. How are they doing it or how to make something similar? 回答1: Here is a post on the subject http://isgeek.eu/google-chrome-extension-google-search The trick is to use document