browser-extension

How to use React without unsafe inline JavaScript/CSS code?

旧街凉风 提交于 2019-12-01 21:26:44
Background I have to use a Content Security Policy for a react application. The reason, that is however not of a big matter here, is, that I am creating a WebExtension/Browser Extension/add-on and these do have such a content security policy , and there things like 'unsafe-eval' and 'unsafe-inline' are strictly disallowed : extensions with 'unsafe-eval', 'unsafe-inline', remote script, blob, or remote sources in their CSP are not allowed for extensions listed on addons.mozilla.org due to major security issues. I have created the app with create-react-app loosly following this guide . The

How to detect that Google Instant page has loaded completely?

*爱你&永不变心* 提交于 2019-12-01 16:05:44
问题 I'm working on a browser extension (think SEOQuake) - I need to display some data about the search results that are shown. Issue: If anything is added to the Google Instant results page while it's still in the process of being loaded, it'll overwrite any additions. I caught myself writing some really wonky setInterval business (waiting until the contents of ol#rso stop changing in size, stuff like that) so I suppose that means I'm not sure how to reliably determine if the page is done loading

How to create plugins/addons for firefox, IE and chrome

◇◆丶佛笑我妖孽 提交于 2019-12-01 14:18:22
I need to create plug-ins/add-ons for IE, firefox and chrome browsers for the following requirement: If the url requested is in a particular format/ matching a particular regex pattern, the plugin has to block the request and pop up and alert box. I have searched a lot but did not find anything helpful. For IE, I think we can create BHO for this purpose. But is there a way to achieve this using javascript? Thanks in advance. Regards, Maggi Unfortunately, IE's addon development is still very arcane compared to Firefox and Chrome for the behavior you're trying to accomplish. You'll have to

How to create plugins/addons for firefox, IE and chrome

泄露秘密 提交于 2019-12-01 10:46:49
问题 I need to create plug-ins/add-ons for IE, firefox and chrome browsers for the following requirement: If the url requested is in a particular format/ matching a particular regex pattern, the plugin has to block the request and pop up and alert box. I have searched a lot but did not find anything helpful. For IE, I think we can create BHO for this purpose. But is there a way to achieve this using javascript? Thanks in advance. Regards, Maggi 回答1: Unfortunately, IE's addon development is still

REST development plugin for browser with all HTTP methods

淺唱寂寞╮ 提交于 2019-12-01 06:13:36
Is there a plugin for any web browser which gives you a GUI to perform PUT's, DELETE's etc? I've written a navigable REST app, and I would like to be able to poke around a bit with my browser to try it out and to demo the API, but since they all lack DELETE and PUT it becomes cumbersome. There are several FireFox plugins for that, including "Poster" and "REST client". You can poke around easily by serving http://www.aminus.net/wiki/Okapi alongside your regular site content. It allows not only DELETE and PUT, but any custom method. In addition, you have complete control over the headers. It's a

How do I get the element being edited?

拥有回忆 提交于 2019-12-01 02:01:40
I'm developing a webapp, and I have a problem with the JavaScript. The following is a simplified version of the HTML causing the problem. I have some nested contenteditable divs (I replaced the real content with placeholder text): <div contenteditable="true" id="div1"> text <div contenteditable="inherit" id="div2"> text <div contenteditable="inherit" id="div3"> text </div> text </div> text </div> I want to get the element that's selected (being edited by the user) via JavaScript, but so far I haven't found a way to do it (successfully). What I have tried and why it doesn't work: I have tried

Access to image and video data from browser extension (vs CORS)

两盒软妹~` 提交于 2019-11-28 08:58:21
问题 I'm trying to write a browser extension that does some image processing but I need access to the image data. My approach was to create a hidden canvas element, draw images and video to it via drawImage , and then read the pixel data with getImageData . This works just fine but on many pages half the content is denied by CORS errors. I'm still confused as to why CORS exists (something along the lined of not stealing data, but then if the data is on the client's computer isn't it "stolen"

Testing browser extensions

蓝咒 提交于 2019-11-28 02:54:11
I'm going to write bunch of browser extensions (the same functionality for each popular browser). I hope, that some of the code will be shared, but I'm not sure about this yet. For sure some of extensions will use native API. I have not much experience with TDD/BDD, and I thought it's good time to start folowing these ideas from this project. The problem is, I have no idea how to handle it. Should I write different tests for each browser? How far should I go with these tests? These extensions will be quite simple - some data in a local storage, refreshing a page and listening through web

How to view/delete local storage in Firefox? [closed]

久未见 提交于 2019-11-28 02:50:20
In Google Chrome there is an easy way to see what's in local storage as well as modify or delete it after inspecting it. Is there a tool or something to do the same in Firefox? You can delete localStorage items one by one using Firebug (a useful web development extension) or Firefox's developer console. Firebug Method Open Firebug (click on the tiny bug icon in the lower right) Go to the DOM tab Scroll down to and expand localStorage Right-click the item you wish to delete and press Delete Property Developer Console Method You can enter these commands into the console: localStorage; // click

Chrome extension content script re-injection after upgrade or install

江枫思渺然 提交于 2019-11-27 10:29:42
After the Chrome extension I'm working on is installed, or upgraded, the content scripts (specified in the manifest) are not re-injected so a page refresh is required to make the extension work. Is there a way to force the scripts to be injected again? I believe I could inject them again programmatically by removing them from the manifest and then handling which pages to inject in the background page, but this is not a good solution. I don't want to automatically refresh the user's tabs because that could lose some of their data. Safari automatically refreshes all pages when you install or