google-chrome-extension

chrome extension to access content of downloaded files

醉酒当歌 提交于 2020-01-01 11:59:26
问题 I'm working on a Chrome extension and I'd like to have the extension: Click on a link to initiate a file download Once the download is complete, open and read the contents of the downloaded file Do something with the contents of the file in JavaScript I see that the chrome.downloads API allows me to initiate the download and open the file, but is it possible for me to read the contents of the file (without writing native code)? 回答1: I'm copying the answer I gave here. You just need to add a

getting hyperlink text on Chrome right click

允我心安 提交于 2020-01-01 11:39:11
问题 In the Chrome extension I'm working on right now, there's a situation where if the user right-clicked on this link: <a href="http://www.google.com">Hello</a> and selected a certain option from my extension's context menu, I need the string "Hello" to be captured in some form. As the Context Menus API shows, it's easy to capture text from a right-clicked selection or the actual URL of the hyperlink (in this case, Google.com) , since these appear in OnClickData, but I'm not sure how I would

Chrome Extension Capture Tab Audio

泄露秘密 提交于 2020-01-01 10:00:46
问题 I'm trying to create a Chrome extension that captures the audio from the active tab and either sends it to another server or makes it accessible via a URL. I'm using the chrome.tabCapture.capture API and can successfully get a MediaStream of the tab's audio, but I don't know what to do after that. The Chrome docs have nothing about MediaStreams so I've looked through some documentation here and played with the JS debugger to see what methods are available, but can't find a way to send the

Can a chrome extension run code on a chrome error page? (i.e. ERR_INTERNET_DISCONNECTED)

风格不统一 提交于 2020-01-01 09:34:06
问题 I am trying to create a chrome extension that runs some javascript code on the chrome error page that has the running dinosaur mini-game. I am getting a permission error when trying to run executeScript on the tab. Here is my code: manifest.js { "manifest_version": 2, "name": "Extension Name", "description": "desc", "version": "1.0", "background": { "scripts": ["script.js"] }, "permissions": [ "tabs", "webNavigation", "<all_urls>" ] } script.js chrome.webNavigation.onErrorOccurred.addListener

Google Chrome - Screen capture failing when iframe is used, same script works without iframe

点点圈 提交于 2020-01-01 09:33:08
问题 When i use this following script it works with normal browser. But when iframe is used then its showing me this error: Does anyone know what is causing this and can be resolved? ERROR: channel message Object {type: "getScreenPending", id: 24504, request: 6} content.js:4 channel message Object {type: "gotScreen", id: 24504, request: 6} content.js:4 >>> ShareScreen: if any err NavigatorUserMediaError {constraintName: "", message: "", name: "InvalidStateError"} test.js:1616 manifest.json: {

SWFobject in a Chrome Extension - API Unavaiable

陌路散爱 提交于 2020-01-01 09:25:09
问题 Hi! I'm building a Chrome extension, in which I need to embed a SWFobject in the background page. Everything works, except the JavaScript controls for the SWFobject and the eventListeners. My guess is that it has something to do with the cross-domain policies, because while testing the page on a webserver everything worked fine. Anyway, here's a snippet: In the main page: var playerView = chrome.extension.getBackgroundPage(); $('#playerPause').click(function(){ playerView.playerPause(); });

Access local files through Google chrome extension?

♀尐吖头ヾ 提交于 2020-01-01 09:18:31
问题 I need to load a list of names into my google chrome extension from a local file, How can this be done? what if the file is shipped with the extension itself? 回答1: If this file is shipped with your extension then you can just load it with XMLHttpRequest inside background page (use relative paths, with / being extension root folder). You can also make your file to be javascript ( var config=[...] ) and just load it with <script> into background page. 回答2: Say your json file is names.json in

In Chrome Extension, change referrer for ajax requests sent to certain domain?

半腔热情 提交于 2020-01-01 09:11:54
问题 I've done some research and I now know it's not possible to send a request with a changed referrer in Google Chrome because the browser will overwrite the change, but is there anyway/any permissions in a Google Chrome Extension that would disable this, or make it so that you could send a request to a certain domain with a different referrer? 回答1: chrome.webRequest is what you're looking for, specifically thee onBeforeSendHeaders event. It will allow you to change any headers (even unsafe ones

Why won't my icon show up as full size on the new Chrome Web Store?

a 夏天 提交于 2020-01-01 08:52:32
问题 I have a published extension in the Chrome Web Store. Last night, the web store got an updated look, and now my icon appears really small, inside of a jigsaw puzzle piece. I followed the instructions, and uploaded a 128, 48, and 16. All three image files are PNG. My extension is the only one I have seen that is displaying in this way. What did I do wrong? 回答1: It's a feature of the store, not a problem with your listing. All extensions now show their icon inside of a jigsaw puzzle piece;

Why won't my icon show up as full size on the new Chrome Web Store?

北城以北 提交于 2020-01-01 08:51:33
问题 I have a published extension in the Chrome Web Store. Last night, the web store got an updated look, and now my icon appears really small, inside of a jigsaw puzzle piece. I followed the instructions, and uploaded a 128, 48, and 16. All three image files are PNG. My extension is the only one I have seen that is displaying in this way. What did I do wrong? 回答1: It's a feature of the store, not a problem with your listing. All extensions now show their icon inside of a jigsaw puzzle piece;