google-chrome-extension

Integrate chrome extensions with phantomjs

♀尐吖头ヾ 提交于 2019-12-20 18:43:10
问题 Is there a way we can install chrome extensions (.crx) with phantomjs? My task here is to integrate adblockplus with phantomjs so that I can filter all the ad-urls and report using phantomjs. Or any other way to integrate the adblockplus extension with phantomjs? 回答1: PhantomJS is based on a three-year old WebKit fork (QtWebKit), not Chromium. Therefore you cannot load Chrome extensions in PhantomJS. If you want to use Chrome extensions in an automated way, I suggest to use the ChromeDriver

How to make popup.html links open in tab?

假如想象 提交于 2019-12-20 13:14:10
问题 I have a Chrome extension that has some links in it. Currently when clicked the links do nothing, i would like to make them open in a new tab when clicked. Is this possible? 回答1: Add target="_blank" to links. Another way is to attach link opening javascript code to mousedown event on a link. You can also use base tag to make all links open with target="_blank" : <head> <base target="_blank"> </head> 回答2: I had the same issue and this was my approach: Create the popup.html with link (and the

Retrieve all data from LocalStorage (without knowing the key name)

泪湿孤枕 提交于 2019-12-20 12:39:29
问题 I'm looking for a way to get all the information out of localStorage. The trouble I'm having is I don't know what the data will be as it is user generated. So here what happens, a user inputs some text, it uses javascript to manipulate it depending on what check boxes they have ticked on the input form. these boxes are for symbols for example if they tick the box for @ then the text + the @At (symbol then word) will be placed in local storage with the other half of the pair as a Boolean (1 or

How to read a file on paste event in HTML5

半城伤御伤魂 提交于 2019-12-20 11:52:33
问题 In HTML5 we know that we can read files using predefined API. As of now I have tried <input type="file"> and the File Drop method. They have worked fine for me. But I want to know the possibility of pasting a file on a div and capturing the file on paste. For Example $('#dummyDIV').bind('paste',function() { // Like var file = files[0] }); Thanks 回答1: You can only read the file name of pasted file. http://jsfiddle.net/vdNFR/ $('body').bind('paste', function(a, b, c) { console.log(a

Developing Chrome Extensions Using NPAPI in C++

99封情书 提交于 2019-12-20 10:57:06
问题 I want to develop a simple Chrome extension in C++, using NPAPI, which does the job of dumping the HTML content of the current page onto a file. I don't have much expertise in developing plugins/extensions. How do I get started on this? 回答1: 1 - Create a Extension... http://code.google.com/chrome/extensions/getstarted.html 2 - Create a NPAPI plugin... http://colonelpanic.net/2009/03/building-a-firefox-plugin-part-one/ 3 - On the manifest of your extension add the plugin... "plugins": [ {

Chrome extension: webRequest.onBeforeSendHeaders behaves strange

时光毁灭记忆、已成空白 提交于 2019-12-20 10:47:30
问题 I am trying to add a "Referer"-HTTP-Header to certain AJAX requests in my Chrome extension. You can't change it directly in the AJAX request so I tried to change it using the webRequest api: chrome.webRequest.onBeforeSendHeaders.addListener(function(data) { console.log("onBeforeSendHeaders fired"); var xdata=data.requestHeaders; xdata.push({ "name":"Referer", "value": "http://the.new/referrer" }) return {requestHeaders: xdata}; }, { //Filter urls: ["<all_urls>"], //For testing purposes types:

Chrome contextMenus API ContextType

天大地大妈咪最大 提交于 2019-12-20 10:42:08
问题 I am looking at the API for chrome.contextMenu here. The context types listed are: "all" "page" "frame" "selection" "link" "editable" "image" "video" "audio" "launcher" "browser_action" "page_action" Some of these are intuitive, the others not so much. Where can I find definitions for these different contexts? It is hard to make use of the api without this background knowledge. Specifically, I would like to know "page", "frame", "editable", and "launcher". 回答1: "link", "image", "video",

How to link to chrome extension like Chrome Web Store?

空扰寡人 提交于 2019-12-20 10:34:55
问题 I'd like to self host a chrome extension on my own site but would like the install experience to be the same as on the chrome web store. Specifically, I'd like to have a "add to chrome" button which asks the user to install the extension with one more click. Currently on self hosted extensions you have to confirm the download and then confirm the install. Here's an example of the web store: https://chrome.google.com/webstore/detail/olnconaknblgbkfgknkfmmfhhbebkekd The only reason I'd like to

What are Chrome apps vs plugins vs extensions and how to develop them

末鹿安然 提交于 2019-12-20 10:16:08
问题 I am trying to understand about Chrome (browser) development. I am very new to this and trying to figure out where to start in order to develop for Chrome Browser. Just have a couple of questions: What is the difference between Chrome Browser apps vs. plugins vs. extensions (not sure, if this question make sense. But, hope you got what I am asking for) What kind of applications can I develop for Chrome Browser What technologies do I need to learn in order to develop for Chrome Browser. 回答1:

Chrome extension - encrypting data to be stored in chrome storage

∥☆過路亽.° 提交于 2019-12-20 10:11:59
问题 I have a chrome extension which stores some user data locally using the chrome.storage API. So, quoting from the documentation: Confidential user information should not be stored! The storage area isn't encrypted. Anyway I would like to encrypt my extension's data before storing it, and I'd like to know: does Google provide a way to do this? And, if not, is there any other way? 回答1: DISCLAIMER: No effort whatsoever in obfuscating client-side JavaScript will make it secure enough. Solutions