google-chrome-extension

Get localStorage from within extension without loading a page

核能气质少年 提交于 2019-12-22 14:42:36
问题 I know how to get the localStorage from any open wep page by using content scripts. So I'm basically able to open a new tab with my own web page and read the storage data with a content script and message it to the background page. But now I'd like to do this without loading an external page every time. Is there a way to access the localStorage of a page directly from within the extension? Maybe some query to chrome directly. 回答1: I don't see any API for that. Your options are: Make a native

I set geolocation permission in the manifest, but every page still asks to share location

旧巷老猫 提交于 2019-12-22 13:57:22
问题 I'm using a content-script in a chrome extension that I'm writing. I included geolocation in my list of permissions, but on every webpage I still get asked if I want to share my location. I thought if I set geolocation in the list of permissions, I would avoid this? Here's the relevant code from my manifest.json : "permissions": ["geolocation"], "content_scripts": [ { "matches": ["<all_urls>"], "js": ["main.js"] } ] And how I'm using it: navigator.geolocation.getCurrentPosition(function

Chrome extension API webRequest doesn't work well on response

妖精的绣舞 提交于 2019-12-22 12:31:28
问题 So I'm trying the Chrome API webRequest. Everything works fine on request, but on response, I got problems. My testing is pretty straight forward: function func(obj) { var resHeaders=obj.responseHeaders; for(var i=0;i<resHeaders.length;i++) { if(resHeaders[i].name=="X-Powered-By" && resHeaders[i].value.indexOf("PHP")>=0) { resHeaders[i].value="Extension"; resHeaders.push({name:"X-Test",value:"Found"}); chrome.pageAction.show(obj.tabId); break; } } return {responseHeaders:resHeaders}; } chrome

Can chrome WebRequest API monitor the http request?

♀尐吖头ヾ 提交于 2019-12-22 12:20:41
问题 I want to monitor all the http request send from my chrome browser, and collect all the http request to another server. I have read This question and These examples, but I don't know how to get the content of the request. For example, when I browse google.com in my chrome browser with this chrome extension, this extension will send the following the another server which will collect it: GET http://www.google.com/ HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: zh-CN

Using Dart in Chrome extension content script does not run?

徘徊边缘 提交于 2019-12-22 12:16:07
问题 I am trying to write a Chrome extension using Dart. So far everything goes well except for the content script --- the "main" function in the content script dart file does not seem to run. To be more specific, first of all Dartium cannot be used since giving a dart file in the "js" rule in the manifest caused Dartium to complain; I next tried to compile the dart file (with csp: true) then make the manifest to include the compiled js file directly --- then I'm stuck, it seems that no matter

Install chrome extension as external extensions

匆匆过客 提交于 2019-12-22 11:37:10
问题 I need install chrome extension as a manual way. So I follow this page https://developer.chrome.com/extensions/external_extensions. I install chrome extension with registry. Everything was fine. But the problem is: that extension cannot "remember anything". Each time I close and open chrome, it was installed again (extension show a welcome page) and everything it save from last session has gone. That problem does not exists if I install it as a normal way. So there are anyway to solve it? 回答1

Debugging Electron renderer process with VSCode

雨燕双飞 提交于 2019-12-22 11:28:51
问题 I tried this document, but hit a problem. I went through the guide one by one and it is all fine until "1. Update the contents of renderer.js to" in "Debugging of the renderer process" section. But when I try "2. While your debug session is...." , VSCode shows the image like below and I cannot attach the debugger to the Electron process. The list in the image shows the tabs of my browser but there's no option corresponding to the electron process launched by the Main debugger. How do I solve

Convert Image to Binary Data or String in Javascript

徘徊边缘 提交于 2019-12-22 11:26:41
问题 I am working on uploading image file to TWITPIC using XMLHttp Request on a Chrome Extension . I need to send the image as payload. Is there a way to do this ? I found this link Convert an image into binary data in javascript But that works on image tags. i need a way to specify image file path and upload image to TWITPIC. I came to know about FileReader API with HTML 5. Is there any way to work using that??. It should work on a local file. Does Chrome Extension support FileReader API without

How to send longer emails from a Chrome extension?

心已入冬 提交于 2019-12-22 11:21:06
问题 I would like to make a Chrome extension that lets users send emails with certain text automatically filled in. I was using a mailto: link, but it cannot handle strings longer than 1024 characters, and it cannot create html links. Is there a way I can fill in additional text and maybe even HTML links, from within the email page (perhaps with local storage)? 回答1: Unfortunately there is no native chrome/javascript API to my knowledge. I did some searching and found an open source option that

Google Chrome Extension - Help needed

本小妞迷上赌 提交于 2019-12-22 11:18:12
问题 Im new on Google Chrome Extensions coding, and i have some basic questions. I want to make a Chrome Extension, and the scheme is the following: -a popup window, containing buttons and result fields (popup.html) -when a button is clicked, i want to trigger an event, this event should connect to a webserver (i make the servlet too), and gather information from the server. (XMLHttpRequest()) -after that, i want my extension to load the gathered information into one of the result fields. Simple,