google-chrome-extension

Accessing Cookies in Chrome Extension

柔情痞子 提交于 2020-01-04 06:43:28
问题 I'm trying to write a chrome extension that works with YouTube and need to access some of YouTube's cookie information. I cant seem to get my extension to see any cookies. (Even though I can see them under resources in the "Inspect Element" developer portion of Chrome). I'm pretty sure I've set up permissions correctly in the manifest 2 file because when I take out the "cookies" permission just to test it I get an error saying "Cannot call method 'getAll'". My current problem is just that no

How does same-domain policy apply to background scripts (NON-content scripts) in Firefox and Chrome extensions?

本小妞迷上赌 提交于 2020-01-04 06:36:06
问题 To my understanding, there are two types of scripts in an extension, one is "content scripts" that run from, and interact with DOM in webpages, which are governed by the same origin policy; the other are scripts, call them "extension scripts" , that run in the background and may or may not interact with webpages, like main.js in Firefox or background.js in Chrome. Here is Google's explanation for extension scripts "...have a single long-running script to manage some task or state ...the

how to load JS from a chrome extension popup

六眼飞鱼酱① 提交于 2020-01-04 06:31:28
问题 background I simply want to create a chrome extension where I click on the extension icon, it loads a popup that loads a javascript file. I was able to do an html only popup simply by adding these two files: manifest.json { .. "browser_action": { "default_popup": "popup.html", .. } } popup.html <html> .. hello world </html> problem I want to actually load a chrome events page so that the popup page calls the events page and interacts with it. what i have tried I added this to manifest.json

document.write in Chrome Extension

混江龙づ霸主 提交于 2020-01-04 05:34:22
问题 I'm new to this so please bear with me. I am trying to write a chrome extension that does the following: Detect www.website.com/anypage.html. If this website is detected, then do the following. Don't load the URL. Instead, write a blank document with a hyperlink to www.website.com/anypage.html?ie=UTF8 The script is set to run at document start (in the manifest). Here is my code: Detect URL: var regExp = /website.com/gi; var match = 0; testString = window.location.href.toString(); if(regExp

Content script on chrome error page

不问归期 提交于 2020-01-04 05:25:11
问题 How can I run my extension content script on Google Chrome error page? For example on the "This webpage is not available" error page? Here is my manifest.json config: { "manifest_version": 2, "name": "injectbox", "version": "1.1", "background": { "scripts": ["jquery-1.11.1.min.js", "bg.js" ] }, "content_scripts": [ { "js": [ "jquery-1.11.1.min.js" ], "matches": [ "<all_urls>" ], "match_about_blank": true, "run_at": "document_end" }, { "js": [ "content.js" ], "css":["styles.css"], "matches": [

Loading A Native Client Chrome Extension For A Particular MIME Type

丶灬走出姿态 提交于 2020-01-04 04:28:26
问题 I have created a Native Client application for the Google Chrome web browser that plays special types of audio files. Great; that part works very well at this point. I'm ready to move to the next phase-- sharing this app with the world. I need help with this part. Per my understanding, the best method for distributing this app is to package it as a Chrome extension, uploading it to the Chrome Web Store (CWS), and using inline install from my website which contains the audio files. Further,

chrome extension: how to mute all audio from certain tab

╄→гoц情女王★ 提交于 2020-01-04 03:03:12
问题 I have been searching for something in chrome extension reference to find anything that would allow me to manipulate audio level of a tab. Only option that has come to my mind is make script have it go through all elements in page and either remove them or mute them if possible. But i feel there has to be a way to reroute all audio streams to nothing, like break them from output which is speakers if using audio api of html5...however no avail either with chrome extension apis or web audio api

chrome.tabs.update() redirects to 'chrome-extension://invalid/'

大城市里の小女人 提交于 2020-01-04 03:02:22
问题 I've written a chrome extension that redirects the current tab based on the value of a timer injected as a content script. A background script keeps track of elapsed times across all open tabs by polling each timer every once in a while, and if time spent on a particular site is over a given limit, redirects the active tab to an interstitial page with the option to reset the timer and restore the previous URL. This works, but once the timer has been reset once, chrome.tabs.update() redirects

How to set download location via chrome api

放肆的年华 提交于 2020-01-04 02:11:11
问题 I am using chrome.experimental.downloads.download() to download url, but I cannnot set downloads location. All the url downloaded to default location of chrome. I have tired {url: xxxxxxxxxx, filename"\file\pic.jpg"}, but that didn't work.I don't known how to use chrome.experimental.downloads.setDestination() which might work. Any hints? Thanks~ 回答1: You currently cannot set the destination, it's not a function that is available in the API. The only mention I can find of setDestination is in

window.open not not able to open more than two links

≡放荡痞女 提交于 2020-01-03 18:00:31
问题 As per my requirement, i need to create a Google Chrome Extension which opens multiple links (25+) on a single click in different tabs of a single chrome window. The code was working fine earlier till the Chrome 18. Now, I am using chrome 24 and that code stopped working. I was simply storing all the links in an array and opening them using a for loop as follows: for(var i = 0; i<links.length; i++) { var tablink = links[i]; if(links[i] != "") { tablink = *"somedomain"* + tablink; setTimeout