kandi X-RAY | webextensions-examples Summary
kandi X-RAY | webextensions-examples Summary
Example Firefox add-ons created using the WebExtensions API
Top functions reviewed by kandi - BETA
- Display a note display
- Listen for events on the page
- Remove data from stored time .
- Replace all text nodes with text content inside a node .
- Creates suggestions from suggestions .
- Process permission change
- Show the cookie in the list of available cookies
- Finds results in the current tab
- Detects if accessKey is supported in the browser .
- Render element descriptions
webextensions-examples Key Features
webextensions-examples Examples and Code Snippets
Trending Discussions on webextensions-examples
Here is my background script;...
ANSWERAnswered 2021-Dec-30 at 08:00
activeTab works only when the user explicitly invokes your extension as described in the documentation for WebExtensions and Chrome extensions). Evidently, its name is highly misleading: it should have been something like
In order to access any tab without prior interaction with your extension you'll have to add broad host permissions in manifest.json:
I created a temporary Firefox add-on which opens a new tab when an icon is clicked. I used the example provided in this link:
This works fine but the new tab opens to a fixed URL. So added a preferences page using the code provided in this link:
Now I'm able to save a URL in the preference page of the extension and the saved URL can be verified in the Extension Storage, here is an image showing it:
ANSWERAnswered 2021-May-31 at 07:30
Since you have the
onGot(item) function working. You should give your
preference_url a name to be traced from.
As you can see, when you inspect the [ Extension Storage ]. The
preference_url is stored in a key named as type.
So, you should give it a name like
preferred_URL or other name for easy tracking.
New to web extension development & I'm trying this example. However when I run this extension it does not trigger the listener.
This is the manifest file....
ANSWERAnswered 2021-Mar-01 at 08:49
To intercept resources loaded by a page (such as images, scripts, or stylesheets), the extension must have the host permission for the resource as well as for the main page requesting the resource.
So, you also need to add
127.0.0.1 in manifest.json because it's not the same as
localhost, which can actually point to a different IP.
I am currently making an extension, and I hope I could get some practical advice on feasibility :
I want my extension to go fetch/load a local folder of custom homescreen thumbnails(top-sites), and then replace the auto-generated thumbnails in the homescreen with those it loaded. The extension would be able to read the associated domain names of the thumbnails and then replace them accordingly.
(e.g :Pinned Url : youtube.com/anything : Ok so it’s YouTube : then replace the thumbnail with “Custom_Youtube_Thumbnail.png”)
Does that seems possible to you ? (Before I dive in head first) I saw that the top-sites API is not quite available https://bugzilla.mozilla.org/show_bug.cgi?id=1246693 but maybe I’m wrong.
Extra : My extension is switching themes (like this : https://github.com/mdn/webextensions-examples/tree/master/theme-switcher ). Would it be possible to switch the thumbnails accordingly (Custom_Youtube_Thumbnail_light.png > Custom_Youtube_Thumbnail_dark.png) as i’ve made a version for each.
Would be a pleasure to hear your opinion on this, or just pointing useful resources to me, I’m not asking for a perfectly baked solution. Hope I’ve been concise.
Thanks for reading me !...
ANSWERAnswered 2020-Dec-08 at 19:01
Very nice idea you had. But In short: no possible.
Main problem is that you cannot inject and manipulate on the homepage which is a built in browser tab.
"You cannot inject code into any of the browser's built-in pages, such as: about:debugging, about:addons, or the page that opens when you open a new empty tab." https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript
I'm writing a plugin in thunderbird using native messaging (following the ping pong example in python) to call a Delphi program to copy an e-mail locally as an ".eml" file. The problem I am facing seems to be the encoding. In addition, the resulting file contains double quotes ("") at the start and the end of the file as well as escaped double quotes (\"). I just want to have a 1 to 1 copy and not to change its content.
Example of a mail content:...
ANSWERAnswered 2020-Oct-28 at 16:11
At first let me say that you did a good job in transferring data between web extension (Thunderbird add-on) and native application using native messaging. It isn't easy to understand it and set it up, but you managed to transfer required data with some tiny glitches you describe in your question.
... the resulting file contains double quotes (
") at the start and the end of the file as well as escaped double quotes (
In the add-on you obtain raw email data as a string -
console.log(typeof raw) gives
string which you then pass to
port.postMessage. Although the documentation says it takes JSON object representing the message to send, but it seems to accept single string value which is valid JSON according to some standards. In Delphi code you receive the message via
STDIN and parse it using
TJSONValue. It will in fact create instance of
TJSONString. You can verify that by examining the value of
jsonValue.ClassName. The problem with quotes arises when you use
jsonValue.ToString which returns quoted version of the string that is basically the same what you had before parsing. Use the
Value property to return raw string value.
To encode raw message data as Base64 string in add-on use function btoa:
No vulnerabilities reported
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page