cannont add webextension commands example to Addon debuger

38 views
Skip to first unread message

Vulcanos Tvorba webových stránek

unread,
Jul 5, 2016, 6:10:31 AM7/5/16
to mozilla-labs-jetpack
I tried the example commands here but when I try to add it to Addon Debugger I don't see the addon in the list. I also tried to press the hotkey of the addon and also it does not work (Windows). I have the FF 47. What is wrong?

Vulcanos Tvorba webových stránek

unread,
Jul 5, 2016, 3:53:06 PM7/5/16
to mozilla-labs-jetpack
This line makes problem in my FF 47.0.1

"commands": {
    "toggle-feature": {
      "suggested_key": { "default": "Ctrl+Shift+U" },
      "description": "bla bla"
    },
when I add it to any addon, the addon will not be loaded.

Why? Is it bug?

William Bamberg

unread,
Jul 5, 2016, 4:17:45 PM7/5/16
to mozilla-la...@googlegroups.com
For the examples in https://github.com/mdn/webextensions-examples, you can check this by looking at the "strict_min_version" key in manifest.json. For example: https://github.com/mdn/webextensions-examples/blob/master/commands/manifest.json#L13.


--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.
To post to this group, send email to mozilla-la...@googlegroups.com.
Visit this group at https://groups.google.com/group/mozilla-labs-jetpack.
For more options, visit https://groups.google.com/d/optout.

Vulcanos Tvorba webových stránek

unread,
Jul 5, 2016, 5:42:51 PM7/5/16
to mozilla-labs-jetpack
Thank you for clarification. I did not know there is already v48 but I read about it to be released at August. I installed the beta version and the examples works now.

May I ask you about Favourite color demo?
https://github.com/mdn/webextensions-examples/tree/master/favourite-colour
I have seen the options_ui option generates window which is not practical, because I would like to generate different window rather like here
https://addons.cdn.mozilla.net/user-media/previews/full/132/132018.png?modified=1406526768
than the window which is similar to addons manager. What I would like to reach is a simple window, where wont be any buttons on the left side and no search bar on the top. Such window is better because it can be bigger even on small screen and small resolution like 800x600. So many form elements can fit onto the html page. Is it possible to do it with webextension?

On Tuesday, 5 July 2016 22:17:45 UTC+2, wbamberg wrote:
For the examples in https://github.com/mdn/webextensions-examples, you can check this by looking at the "strict_min_version" key in manifest.json. For example: https://github.com/mdn/webextensions-examples/blob/master/commands/manifest.json#L13.

On Tue, Jul 5, 2016 at 12:53 PM, Vulcanos Tvorba webových stránek <tvorba.webu.h...@gmail.com> wrote:
This line makes problem in my FF 47.0.1

"commands": {
    "toggle-feature": {
      "suggested_key": { "default": "Ctrl+Shift+U" },
      "description": "bla bla"
    },
when I add it to any addon, the addon will not be loaded.

Why? Is it bug?


On Tuesday, 5 July 2016 12:10:31 UTC+2, Vulcanos Tvorba webových stránek wrote:
I tried the example commands here but when I try to add it to Addon Debugger I don't see the addon in the list. I also tried to press the hotkey of the addon and also it does not work (Windows). I have the FF 47. What is wrong?

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jetpack+unsub...@googlegroups.com.

William Bamberg

unread,
Jul 5, 2016, 5:54:54 PM7/5/16
to mozilla-la...@googlegroups.com
On Tue, Jul 5, 2016 at 2:42 PM, Vulcanos Tvorba webových stránek <tvorba.webu.h...@gmail.com> wrote:
Thank you for clarification. I did not know there is already v48 but I read about it to be released at August. I installed the beta version and the examples works now.

May I ask you about Favourite color demo?
https://github.com/mdn/webextensions-examples/tree/master/favourite-colour
I have seen the options_ui option generates window which is not practical, because I would like to generate different window rather like here
https://addons.cdn.mozilla.net/user-media/previews/full/132/132018.png?modified=1406526768
than the window which is similar to addons manager. What I would like to reach is a simple window, where wont be any buttons on the left side and no search bar on the top. Such window is better because it can be bigger even on small screen and small resolution like 800x600. So many form elements can fit onto the html page. Is it possible to do it with webextension?


As far as I know, your options are basically:
* use options_ui, and have your options integrated into the Add-ons Manager, like favourite-colour
* use options_ui, but specify "open_in_tab" (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/options_ui), then it will open in its own browser page
* just package a page with your add-on, and open it using tabs.create (https://github.com/mdn/webextensions-examples/tree/master/open-my-page-button)
(meta: I recommend that you use the dev-addons list (https://mail.mozilla.org/listinfo/dev-addons), not this list.)

Hope that helps.

Will

 

On Tuesday, 5 July 2016 22:17:45 UTC+2, wbamberg wrote:
For the examples in https://github.com/mdn/webextensions-examples, you can check this by looking at the "strict_min_version" key in manifest.json. For example: https://github.com/mdn/webextensions-examples/blob/master/commands/manifest.json#L13.

On Tue, Jul 5, 2016 at 12:53 PM, Vulcanos Tvorba webových stránek <tvorba.webu.h...@gmail.com> wrote:
This line makes problem in my FF 47.0.1

"commands": {
    "toggle-feature": {
      "suggested_key": { "default": "Ctrl+Shift+U" },
      "description": "bla bla"
    },
when I add it to any addon, the addon will not be loaded.

Why? Is it bug?


On Tuesday, 5 July 2016 12:10:31 UTC+2, Vulcanos Tvorba webových stránek wrote:
I tried the example commands here but when I try to add it to Addon Debugger I don't see the addon in the list. I also tried to press the hotkey of the addon and also it does not work (Windows). I have the FF 47. What is wrong?

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.
To post to this group, send email to mozilla-la...@googlegroups.com.
Visit this group at https://groups.google.com/group/mozilla-labs-jetpack.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.

Vulcanos Tvorba webových stránek

unread,
Jul 6, 2016, 5:17:26 AM7/6/16
to mozilla-labs-jetpack
Thank you Will for your examples. Does it mind if I ask you some questions about your example codes? Currently I am trying the user-agent-rewriter (\popup) . When I click the button it opens the html page bellow the button, but when I click a link no page is opened or redirected. I see there is choose_ua.js which is included in choose_ua.html ... But I try to debug. I have set breakpoints to choose_ua.js #7 where addEventListener is called. Then I click on a button or reload addon and click again. But the debugger never breaks on the breakpoint. So it looks like the file is not loaded - but is must be loaded when the debugger sees it. So I cannot find out why no action happens when I click on a link in the popup. I am using the Addons debugger.

Also I wanted to ask you if do you have some example how to change text size on html page, font family, font color and background of some elements? If not, is it possible to do it with JQuery? I like JQuery and this way it would be easy for me.

What can I expect from the dev-addons list? Are there source codes included?
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jetpack+unsub...@googlegroups.com.
To post to this group, send email to mozilla-la...@googlegroups.com.
Visit this group at https://groups.google.com/group/mozilla-labs-jetpack.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jetpack+unsub...@googlegroups.com.

William Bamberg

unread,
Jul 6, 2016, 12:21:01 PM7/6/16
to mozilla-la...@googlegroups.com
On Wed, Jul 6, 2016 at 2:17 AM, Vulcanos Tvorba webových stránek <tvorba.webu.h...@gmail.com> wrote:
Thank you Will for your examples. Does it mind if I ask you some questions about your example codes? Currently I am trying the user-agent-rewriter (\popup) . When I click the button it opens the html page bellow the button, but when I click a link no page is opened or redirected. I see there is choose_ua.js which is included in choose_ua.html ...

The buttons are not supposed to open pages: they're used to set the `ua` variable[1], which determines which User-Agent string the browser will send when you visit useragentstring.com. Please review the README file for this example[2], which should explain what it does.

 
But I try to debug. I have set breakpoints to choose_ua.js #7 where addEventListener is called. Then I click on a button or reload addon and click again. But the debugger never breaks on the breakpoint. So it looks like the file is not loaded - but is must be loaded when the debugger sees it. So I cannot find out why no action happens when I click on a link in the popup. I am using the Addons debugger.


I'm not sure why exactly you're having problems debugging. Probably what's happening is that each time you open the popup the script is reloaded. So if you have the script open in the debugger, then set a breakpoint, then reopen the popup and click the button, the script handling the click event is a different instance from the one you set a breakpoint in. Please review the docs on debugging WebExtensions[3] and ask for help in dev-addons if you need it.
 

Also I wanted to ask you if do you have some example how to change text size on html page, font family, font color and background of some elements?


You can do this kind of thing in exactly the same way as the borderify.js example, just setting different CSS properties (e.g. font[4], color[5], background-color[6]). If you are not familiar with the use of these properties, you could also review the tutorial on styling text with CSS [7]

 
If not, is it possible to do it with JQuery? I like JQuery and this way it would be easy for me.


You can use jQuery if you want to. However note that the default content security policy[8] that gets applied to WebExtensions will prevent you from loading scripts from a remote location. So you must either package jQuery with your add-on, or modify the default content security policy using the content_security_policy[9] manifest key.
 
What can I expect from the dev-addons list? Are there source codes included?


To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.
To post to this group, send email to mozilla-la...@googlegroups.com.
Visit this group at https://groups.google.com/group/mozilla-labs-jetpack.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.

To post to this group, send email to mozilla-la...@googlegroups.com.
Visit this group at https://groups.google.com/group/mozilla-labs-jetpack.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-labs-jet...@googlegroups.com.

Vulcanos Tvorba webových stránek

unread,
Jul 7, 2016, 9:22:07 AM7/7/16
to mozilla-labs-jetpack
Does it mind if I stay on this channel? I don't like mailing lists because of too much incoming emails. Google Groups is OK for me.

I learned how to use Jquery with webextensions and all works fine. Now I tried to create icons for my webextension. I started with favourite-color because I am facing to learn how to store and read data... But my current problem is that I don't see my icon in addons manager. They are placed in icons folder and named like eye-icon ...

This is the manifest.json:

{
 
"applications": {
 
"gecko": {
   
"id": "some-o...@mozilla.org",
   
"strict_min_version": "48.0a1"
   
}
 
},
"background": {
 
"scripts": ["background.js"]
 
},
"description": "An example options ui",
"homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/favourite-colour",
"manifest_version": 2,
"name": "Favourite colour",
"icons": {
 
"48": "icons/eye-icon-colored-48.png"    
},
"options_ui": {
 
"page": "options.html",
 
"open_in_tab": true
 
},
"browser_action": {
 
"default_title": "Adapt page",
 
"browser_style": true,
 
"default_icon": {
   
"16": "icons/eye-icon-16.png",
   
"32": "icons/eye-icon-32.png",
   
"48": "icons/eye-icon-48.png"
 
},
 
"default_title": "Adapt"
},

"permissions": ["storage"],
"version": "1.0"
}


I added browser action because I want that user can have two choices:
A) either to use the settings to define css rules in a form
B) or to run action which applies css rules on current webpage.
I removed the line which defines  default_popup for browser_action. Add B) I am not sure if this is what I need because I need to run script not to popup window.

So my problem is that I see only one icon in the toolbar, but the icon in addon manager stays the default green icon as used for addon settings. And I want to get there the colored icon of eye eye-icon-colored-48.png if possible or non colored eye-icon-32.png. So if you see the problem, I'll be grateful for advice

Vulcanos Tvorba webových stránek

unread,
Jul 8, 2016, 1:12:21 AM7/8/16
to mozilla-labs-jetpack
No need for answer to previous post, I see the color icon is loaded when I restarted Firefox.
Reply all
Reply to author
Forward
0 new messages