Options page in new Firefox WebExtensions API - google-chrome

Is there a way to write addon options page in new Firefox WebExtensions API?
For example Google Chrome supports manifest key "options_page"
I searched through documentation and wiki but can't find anything on this point.

This answer is out of date as WebExtension support expands.
See Implement a settings page on MDN (and please upvote this answer for providing this link first).
It does not seem like "options_page" manifest key is supported as of now.
Its main use is providing UI discoverability of the options page; a link to it in the extension list, for instance.
If you're porting an existing extension, you'll need to add some other UI in your extension to open the page (e.g. a link in the popup, if the extension has one). You can simply open it with chrome.tabs.create like you would open any page and it will work identically.
A little caveat: if the extension uses OptionsV2-provided CSS styling, you'll need to compensate for its absence.
Another caveat: the chrome.runtime.openOptionsPage() function is not available in Firefox and should be replaced by a shim using chrome.tabs.

Use the options_ui key in your manifest.json. There is nice guide on MDN on how to do this - Implement a settings page.

Both "options_page" and "options_ui" will be implemented in Firefox WebExtensions!
Here is the link for tracking progress http://arewewebextensionsyet.com/#options

Related

How can I edit the body class of this website?

I would like to change the body class="" of a website, in this case it's WhatsApp Web, if you go to inspect element and change body class="web" to body class="web dark" the page becomes dark. How can I save this so I don't have to do this every time I load the page? Thanks!
You'll likely need to use a Chrome Extension for this. Here is a helpful link to a similar use-case where the person was attempting to create their own extension, if you're interested in creating your own solution. Here's a reference from the Google Chrome team on creating your own Chrome extension.
If you're looking for something a little more out-of-the-box, check out this Chrome Plugin, Page Manipulator. There are several other plugins such as TaperMonkey.
The idea is to have some extension in Chrome that will automatically apply the changes you attempting to do directly to the DOM of the page.
what you are trying to do is not possible because each time you reload the page the code will get updated(By updated i mean the orignal code).
But there is a way you can do the same by creating your own add-ons in mozilla or extensions for chrome what this extension will do is whenever they will see a "tag" or "class" matching the constraint will get replace by the value you want.
like in your case from "web" to "web dark".

Where can I modify Chrome bookmarks?

I want to code an extension that modifies your bookmarks in Google Chrome. For example, it should expand different sub-sites (e.g. reddit subreddits) when hovering over a bookmark.
Where do I find the bookmark function, though? Like the part that says for example "when hovering over an icon, background goes grey". I'd have to modify exactly those parts.
For what you are referring to, a simple CSS style modification will achieve. To implement an extension into chrome, you will want to start here:
Google Chrome Extension Development
Some resources for you:
Developer Guide - this contains all the extensible chrome APIs
chrome.bookmarks API - this is the API that will interact with and manipulate bookmarks
There are also some resources out there that are helpful for learning how to create a chrome extension. A good starting point may be this:
How to create and publish a chrome extension in 20 minutes

Browser highlight support for my very own protocol handler

I'm using a class to register my protocol, lets say lorem: to operating system. Its working perfect but I would like to do couple of things.
I want to create something like Skype Click to Call. People will share uri's like lorem://12345678 and when others click this the event handler will redirect that request to my windows application. I want to make this uri clickable. How can identify this new scheme to browsers so when a page contains lorem://12345678, browser will transform it something like
lorem://12345678 and users be able to click it.
Can I do it with browser configuration or should I write some kind of extension to implement this rule. It must support all browsers so is that means I need to write same extension for Chrome, Firefox and IE? And how can I install all extensions with my software setup?
Straight to point question: I want to transform lorem://ipsum text to My URL! on most popular browsers
as i understood -- you need to write extensions for each browser, check out this question:
how do I create my own URL protocol? (e.g. so://...)
and this is an example of browser approach:
Custom protocol handler in chrome

Is it possible to hide extension resources in the Chrome web inspector network tab?

When I'm viewing the downloaded resources for a page in the Chrome web inspector, I also see the HTML/JS/CSS requested by certain extensions.
In the example above, indicator.html, indicator.js and indicator.css are actually part of the Readability Chrome extension, not part of my app.
This isn't too big a deal in this particular situation, but on a more complex page and with several extensions installed, it can get quite crowded in there!
I was wondering if there was a way to filter out any extension-related resources from this list (i.e. any requests using the chrome-extension:// protocol).
Does anyone know how I could achieve this?
Not quite the solution I was after (I'd have preferred a global setting), but there is now a way to filter out requests from extensions, as mentioned by a commenter on the issue I originally opened.
In the network tab filter box, enter the string -scheme:chrome-extension (as shown below):
This is case-sensitive, so make sure it's lowercase. Doing this will hide all resources which were requested by extensions.
Just enter "-f" in Network field
Was having the same question when my extension adds a lot of noise in the network tab.
Some extensions also fire a lot of data like data:text/image etc, you can append more filter with - like:
-scheme:chrome-extension -scheme:data
Another way to get the http/https requests is to just use scheme:https without - because the resources that extensions request are usually from their local bundle:
scheme:https
An Incognito Window, can be configured to include or exclude extensions from the extensions page of Chrome settings.
One alternative is to go to "Network Request blocking" tab and add "chrome-extension:" to the list, thus extension requests will be blocked and coloured red so it's easy to visually filter them out.
you can simply enable this option and requests from extension will be group.
Update: It can only group requests that create by the extension that draw iframe, such as cVim

Creating a Badge-less Google Chrome Extension

According to the docs I have made an Google Chrome Extension that I would describe as a "browser action" because it is present on all pages. However, my extension doesn't require any interaction so having a badge next to the omnibox is pretty wasteful. I have installed extensions that do not appear anywhere (except maybe in the context menu). How is that done and is that best practice?
Having page action or browser action icons is totally optional if you don't have any popup attached to them, so just remove the whole browser_action section from your manifest file.