google-chrome-extension

Chrome Extensions - How can i perform an action, when chrome.browserAction.onClicked has fired?

风流意气都作罢 提交于 2019-12-25 13:26:06
问题 I want to make a browserAction extension, with an icon and a listener on it. I have a manifest file, and a background script, the script is the following: chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.executeScript(null,{code:'some code here'}); }); The code works on the page, i tried it on a different way (popup and a button what fires the action). But if i try it with a browserAction onclick method, nothing happens:( The manifest: { "name": "somename", "version": "1

How can a Chrome extension get a user's permission to use user's computer's microphone?

浪尽此生 提交于 2019-12-25 12:51:48
问题 If we run HTML5's Web Speech API's JavaScript codes below in a website on a Chrome, Chrome will ask for user's permission for the use of user's computer's microphone. var recognition = new webkitSpeechRecognition(); recognition.start(); But if I run codes above on a Chrome extension's page, Chrome doesn't ask users to give a permission. How can a Chrome extension get a user's permission to use user's computer's microphone? Thank you. 回答1: I think you have to implement it yourself. In chrome

How to upgrade a GPO force-installed Chrome Extension?

别说谁变了你拦得住时间么 提交于 2019-12-25 12:45:53
问题 We develop a network security product, incorporating a chrome extension, currently installed by the ExtensionInstallForcelist value in GPO. One of our product features is that surfing the Internet/intranet is separated in to several trust zones - and the chrome extension is responsible for making the switch between different browser windows running in different zones. Sometimes, the update_url in the CRX will not be accessible to browsers running in all trust zones. Since Chrome "imports" the

How do I enable the “chrome.downloads” api on the dev or canary channels?

旧巷老猫 提交于 2019-12-25 12:08:51
问题 I was hoping to do some experimentation with the chrome.downloads api. I downloaded the dev and canary versions of Chrome and created a new extension with the downloads permission, as well as <all_urls> . When I load the extension, the "permissions" link shows I have permission to "Download files" so the permission is being loaded successfully. When I inspect the "chrome" object in the debugger, chrome.downloads is set to undefined . If I go to use the object it causes the extension to unload

Is it possible to extract the text selected by the user in a pdf?

允我心安 提交于 2019-12-25 11:33:15
问题 I have found this post that explains how to extract the text from a pdf in javascript, but I would like to know if it's possible to extract only the text selected by the user. 回答1: You can not. The PDF, unless it's being rendered by a javascript renderer (as-in, pdf.js), can not be accessed at all by the browser's javascript. This is because it's being rendered by a browser plugin that the javascript is intentionally not allowed to access. Your post is tagged with "google-chrome-extension"

How to override download process in Chrome Extension

半世苍凉 提交于 2019-12-25 10:02:25
问题 I am trying to make a download manager extension in chrome browser. I can monitor chrome downloads via chrome.downloads API. But, I want to override the download process and handle download destination with my extension instead of default "saveFileDialog". Is there any way to do so? 回答1: Many download managers are available from the store, so it is possible. Some of them are open-source and available on github, so have a look before starting your own. If you want to replaces the default

How to override download process in Chrome Extension

有些话、适合烂在心里 提交于 2019-12-25 10:00:18
问题 I am trying to make a download manager extension in chrome browser. I can monitor chrome downloads via chrome.downloads API. But, I want to override the download process and handle download destination with my extension instead of default "saveFileDialog". Is there any way to do so? 回答1: Many download managers are available from the store, so it is possible. Some of them are open-source and available on github, so have a look before starting your own. If you want to replaces the default

Chrome Extension: How to persist data in popup across popup clicks

删除回忆录丶 提交于 2019-12-25 08:57:04
问题 I'm trying to get a selected text and show it in the popup.html (extension's). I was able to pass the data using the message passing techniques of chrome extension api but everytime I click on popup, it clears the stored data. So I thought of using the storage api. I managed to store the selected text using chrome.storage.local.set and retrieve it using chrome.storage.local.get. But the data doesn't persists across popup clicks. //Edit: Adding all the files. I figured out the issue.

cannot find chrome extension manifest file

自古美人都是妖i 提交于 2019-12-25 08:49:23
问题 background I'm learning how to build a chrome extension app, and I'm following the instructions in this tutorial (you can see my code here). The instructions in the copy key to your manifest section states that it's important to keep their application id constant and in order to do that, they must copy the key in the installed manifest.json to the source manifest. The instructions state that this manifest.json file must exist in the user data directory, in my case (mac): ~/Library/Application

Code is executing multiple times per event: Multiple downloads

天涯浪子 提交于 2019-12-25 08:48:15
问题 I want to download a JSON object from within the content script. At first, when I request the download, it downloads one file, but at the second request, it downloads two files; at the third request, three files are downloaded, etc. Background.js chrome.browserAction.onClicked.addListener(function (tab) { download(); chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { //Alert the message console.log(request); chrome.downloads.download({ url: request.method,