Options page for Firefox addon using the Add-on Builder (JetPack) - firefox

I am developing a Firefox extension and want to open a custom html page where the user can adjust the settings. I am able to do it in different ways, but would like to use the standard Options button that is shown in the add-on manager of Firefox.
I have seen some documentation about it, but I am having problems on finding proper documentation for this function using the online Add-on Builder:
Preferences system,
Inline options,
Simple prefs.
Does anybody know how to just add that standard Options button that is shown in the add-on manager and handle its click event to show a custom options page? (just like it's possible in Google Chrome)

Builder projects have an 'Properties' dialog that has a field you can paste the extra JSON in that you need to create preferences:
https://www.evernote.com/shard/s1/sh/cdb97850-935d-4cf1-95f1-a25c130d1498/4b0b2553f3aa85e4d6489c1d50492c97
( fixed the link, sorry )
Here's an example in builder that implements all the different types, and contains documentation as well:
https://builder.addons.mozilla.org/package/60337/latest/
You'll notice that one of the type of prefs you can define is a 'control' pref, essentially a button that emits a custom event you can listen of and react to from main.js. You could then open a new tab or addon-page with additional preferences?
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/simple-prefs.html#prefs

Related

Is it Possible to customize the About Tab for custom app in Microsoft Teams?

I am creating one custom application that is going to be available in the MS Teams. I have a requirement to capture data from the users in the About tab.
SO, Is it possible to customize the About Tab in Microsoft Teams for a custom application?
I will need to put the input box and form controls in that About tab.
You definitely can't customize the -capabilities- of the About box - at best you could put in a link directing users where to go to complete the form that you've hosted elsewhere. Note that the About box does support markdown, so it might even be possible to embed the link as an actual hyperlink, but I've not tried that.
As an alternative, perhaps you could offer the needed functionality into the app itself. E.g. if you have a tab, put something in the footer for example.
You cannot customize the About Tab for custom application, This is by design. You can customize the App detail page as documented here.

Show an adaptive card in popup (using tabs configuration url) while bot is installed in msteams

I want to show a task module (not url) while bot installs (with tab) in the teams. Something like Text does, but a bit more interactive with drop downs and all.
I have referred to the link to create deep link for tab and paste the link here, in app-studio manifest editor:
But this doesn't seem to work. Only an empty pop up shows following this procedure.
Can someone correct me, where I am going wrong! TIA!
This "Text" screen is not showing a Task module, it's showing a custom Configuration page for the app's Tab installation. When you create an App that includes a Tab, you have the option of creating such a "Configuration" popup that gives the user the chance to configure how your tab will actually work. See here for more: https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/create-tab-pages/configuration-page
Within that configuration page, you can show whatever web content you'd like. Showing an Adaptive Card is a bit of a strange scenario considering it's a web page, but you could conceivably do this using the adaptive cards js library inside the page (https://www.npmjs.com/package/adaptivecards)

How to display popup with html in firefox bootstrapped extensions?

I developed a firefox bootstrapped extension (without add-on sdk). I need to display a popup with html content, something like panel in add-on sdk. Also, it is necessary that the extension could interact with content in the popup. Also, I need a way to display html content in separate tab and interact with this content. So what can I use to implement what I need?
You can append an iframe to that panel, and then load a page into that iframe. That's what I did in this simple addon here - https://github.com/Noitidart/AwesomeBar-Power-Tip/
Here's another gist that does something similar - https://gist.github.com/Noitidart/9445992
I think this is how the SDK does it as well.
but I can not understand how it is possible to implement the interaction between expansion and content inside the panel.
The panel or its frameLoader property should have a messageManager, which can be used to load frame scripts and pass messages to them.

Use selenium IDE to change Firefox Preferences for SDK Addon testing

I am using Selenium IDE to test some behavior in my FireFox SDK Add-On. For example, I load a page and determine that the content script is executing at intended. In my plugin, I use simple-prefs to set some user defined preferences.
For example, I would like to load a page and then ensure that if a preference is changed, that the content script received the update and made the necessary changes to the page based on the new setting.
when I try to navigate with Selenium-IDE to the plugin configuration page chrome://mozapps/content/extensions/extensions.xul?type=extensions / about:addons. I am able to use Selenium to select an entry (<richlistitem />), but I cannot click any of the buttons within the entry because they are not part of the XUL dom. I have tried using Selenium to send enter, tab, clicks, double clicks to the appropriate <richlistitem /> but there is no way of interacting with the "inner part" of the item.
I have also tried going down the path of using selenium to modify entries via about:config, however, the area with all of the entires is just an XUL <treechildren /> and you have no way of targeting individual entries.
Is there a convenient way to change addon setting as part of an automated workflow with selenium-ide?
It seems you should use Selenium Web driver , by driver you can set preference

how to show a preference page using mozilla Add-on SDK?

I am developing an extension using the Addon-SDK. I want to show a preference page in order to get some users' configuration.
simple-prefs is too simple to use as its supported data type is so limited.
In a XUL app, I can use the following
<em:optionsType>3</em:optionsType>
<em:optionsURL>chrome://myaddon/content/options.html</em:optionsURL>
to set my preference page.
I found
the XUL migration guide
which says:
This is provided only as a migration aid, and it's still a good idea to port XUL windows to HTML.
How then can I make an HTML preference page ?
Many thanks!
I solved it in the following way:
Use simple-prefs with the preference type set to control. On its click event, open a page using the tab module, then use simple-storage to store data.
That's it!

Resources