third-party packages - which do you use?

49 views
Skip to first unread message

Will Bamberg

unread,
Oct 1, 2012, 8:19:12 PM10/1/12
to mozilla-la...@googlegroups.com

As you probably know already, people developing add-ons with the SDK can use third-party packages to fill gaps in the SDK's core API. But many people using the SDK don't know this, or have trouble finding and using them.

I'm planning to write a blog post for the AMO blog highlighting some third-party packages, just including pointers to them and short examples showing their use. I'd love some guidance about which packages to include. Are there packages you find particularly useful, that other people could benefit from using as well?

On a separate topic, are there any packages that you wish someone would write?

Thanks!

Will

Will Bamberg

unread,
Oct 1, 2012, 8:20:23 PM10/1/12
to mozilla-la...@googlegroups.com
On 12-10-01 5:19 PM, Will Bamberg wrote:

As you probably know already, people developing add-ons with the SDK can use third-party packages

Sigh. Or even third-party packages.


to fill gaps in the SDK's core API. But many people using the SDK don't know this, or have trouble finding and using them.

I'm planning to write a blog post for the AMO blog highlighting some third-party packages, just including pointers to them and short examples showing their use. I'd love some guidance about which packages to include. Are there packages you find particularly useful, that other people could benefit from using as well?

On a separate topic, are there any packages that you wish someone would write?

Thanks!

Will

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-la...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=en.

Hernan Rodriguez Colmeiro

unread,
Oct 2, 2012, 9:19:24 AM10/2/12
to mozilla-la...@googlegroups.com
On Mon, Oct 1, 2012 at 9:19 PM, Will Bamberg <wbam...@mozilla.com> wrote:
>
> As you probably know already, people developing add-ons with the SDK can use
> third-party packages to fill gaps in the SDK's core API. But many people
> using the SDK don't know this, or have trouble finding and using them.
>
> I'm planning to write a blog post for the AMO blog highlighting some
> third-party packages, just including pointers to them and short examples
> showing their use. I'd love some guidance about which packages to include.
> Are there packages you find particularly useful, that other people could
> benefit from using as well?
>

Some packages that I find incredibly useful are those written by Erik Vold:

UserStyles: https://github.com/voldsoftware/userstyles-jplib
MenuItems: https://github.com/voldsoftware/menuitems-jplib
ToolbarButton: https://github.com/voldsoftware/toolbarbutton-jplib

Hernán

Christian Sonne

unread,
Oct 2, 2012, 9:21:03 AM10/2/12
to mozilla-la...@googlegroups.com
+1

I'm pretty sure the only third party packages I've ever used were
written by Erik...

-- cers / Christian Sonne

Will Bamberg

unread,
Oct 2, 2012, 11:30:25 AM10/2/12
to mozilla-la...@googlegroups.com
Thanks! I was thinking of adding that I'd prefer they weren't *all*
written by Erik, but that might be a vain hope :-).

Will

On 12-10-02 6:21 AM, Christian Sonne wrote:
> +1
>
> I'm pretty sure the only third party packages I've ever used were
> written by Erik...
>
> -- cers / Christian Sonne
>
>
> On Tue, Oct 2, 2012 at 3:19 PM, Hernan Rodriguez Colmeiro
> <colm...@gmail.com> wrote:
>> On Mon, Oct 1, 2012 at 9:19 PM, Will Bamberg <wbam...@mozilla.com> wrote:
>>> As you probably know already, people developing add-ons with the SDK can use
>>> third-party packages to fill gaps in the SDK's core API. But many people
>>> using the SDK don't know this, or have trouble finding and using them.
>>>
>>> I'm planning to write a blog post for the AMO blog highlighting some
>>> third-party packages, just including pointers to them and short examples
>>> showing their use. I'd love some guidance about which packages to include.
>>> Are there packages you find particularly useful, that other people could
>>> benefit from using as well?
>>>
>> Some packages that I find incredibly useful are those written by Erik Vold:
>>
>> UserStyles: https://github.com/voldsoftware/userstyles-jplib
>> MenuItems: https://github.com/voldsoftware/menuitems-jplib
>> ToolbarButton: https://github.com/voldsoftware/toolbarbutton-jplib
>>
>> Hern�n

Hernan Rodriguez Colmeiro

unread,
Oct 2, 2012, 11:55:43 AM10/2/12
to mozilla-la...@googlegroups.com

On Oct 2, 2012 12:30 PM, "Will Bamberg" <wbam...@mozilla.com> wrote:
>
> Thanks! I was thinking of adding that I'd prefer they weren't *all* written by Erik, but that might be a vain hope :-).
>

Mhh, aside from those I mentioned I just used my own modules (now badly outdated) or the core ones... Well, recently I used a nodeJS Bayesian Classifier module from Heather Arthur (http://github.com/harthur/classifier) with some slight modifications to make it work in the SDK.

Hernan

> Will
>
>
> On 12-10-02 6:21 AM, Christian Sonne wrote:
>>
>> +1
>>
>> I'm pretty sure the only third party packages I've ever used were
>> written by Erik...
>>
>> -- cers / Christian Sonne
>>
>>
>> On Tue, Oct 2, 2012 at 3:19 PM, Hernan Rodriguez Colmeiro
>> <colm...@gmail.com> wrote:
>>>
>>> On Mon, Oct 1, 2012 at 9:19 PM, Will Bamberg <wbam...@mozilla.com> wrote:
>>>>
>>>> As you probably know already, people developing add-ons with the SDK can use
>>>> third-party packages to fill gaps in the SDK's core API. But many people
>>>> using the SDK don't know this, or have trouble finding and using them.
>>>>
>>>> I'm planning to write a blog post for the AMO blog highlighting some
>>>> third-party packages, just including pointers to them and short examples
>>>> showing their use. I'd love some guidance about which packages to include.
>>>> Are there packages you find particularly useful, that other people could
>>>> benefit from using as well?
>>>>
>>> Some packages that I find incredibly useful are those written by Erik Vold:
>>>
>>> UserStyles: https://github.com/voldsoftware/userstyles-jplib
>>> MenuItems: https://github.com/voldsoftware/menuitems-jplib
>>> ToolbarButton: https://github.com/voldsoftware/toolbarbutton-jplib
>>>

>>> Hernán

Erik Vold

unread,
Oct 2, 2012, 12:07:07 PM10/2/12
to mozilla-la...@googlegroups.com
I've used Irakli's protocol package quite a bit https://github.com/Gozala/jetpack-protocol

Erik

Myk Melez

unread,
Oct 2, 2012, 12:24:07 PM10/2/12
to mozilla-la...@googlegroups.com, Will Bamberg
On 2012-10-01 17:19 , Will Bamberg wrote:
As you probably know already, people developing add-ons with the SDK can use third-party packages to fill gaps in the SDK's core API. But many people using the SDK don't know this, or have trouble finding and using them.

I'm planning to write a blog post for the AMO blog highlighting some third-party packages, just including pointers to them and short examples showing their use. I'd love some guidance about which packages to include. Are there packages you find particularly useful, that other people could benefit from using as well?
For a project I'm working on, I use Erik's menuitems and Alex's subprocess (integrating them via Git's support for submodules in addition to the SDK's support for third-party packages).


On a separate topic, are there any packages that you wish someone would write?
My addon opens a data/ page in a tab. I use `tabs` to open the page, `addon-page` to remove chrome from around it, and a content script for communication between the main script and the page.

The tabs/addon-page modules work well enough, but the communication is cumbersome and error-prone, even though I'm familiar with the concepts behind content script-mediated communication (having helped develop them!).

So I'd love a simple, opinionated module that manages an addon page and its communication with the main script.

-myk

Jeff Griffiths

unread,
Oct 2, 2012, 12:27:33 PM10/2/12
to mozilla-la...@googlegroups.com
I've gotten a demo from Brian Clark of his searchspot add-on using
Dietrich's awesomebar module:

http://autonome.wordpress.com/2011/06/08/extensibly-awesome/

https://github.com/clarkbw/searchspot/blob/awesomebar/lib/awesomebar-suggestions.js

Aside: awesomebar support is something we've planned to add to the SDK
for some time, but haven't quite gotten there. I've had a few
discussions with Dietrich and others about this and one issue is that
nsIAutoComplete simple isn't very extensible. I may be mis-quoting,
but I think Dietrich commented at the time that it 'should die in a
fire'. Harsh!

Jeff Griffiths

unread,
Oct 2, 2012, 12:29:25 PM10/2/12
to mozilla-la...@googlegroups.com, Will Bamberg
On Tue, Oct 2, 2012 at 9:24 AM, Myk Melez <m...@mozilla.org> wrote:
...
> My addon opens a data/ page in a tab. I use `tabs` to open the page,
> `addon-page` to remove chrome from around it, and a content script for
> communication between the main script and the page.
>
> The tabs/addon-page modules work well enough, but the communication is
> cumbersome and error-prone, even though I'm familiar with the concepts
> behind content script-mediated communication (having helped develop them!).
>
> So I'd love a simple, opinionated module that manages an addon page and its
> communication with the main script.

I love it! I can see this being particularly useful for mobile add-ons
that need to provide an app-like UI.

Paul Morris

unread,
Oct 2, 2012, 11:18:07 PM10/2/12
to mozilla-la...@googlegroups.com
On Oct 2, 2012, at 12:24 PM, Myk Melez <m...@mozilla.org> wrote:

So I'd love a simple, opinionated module that manages an addon page and its communication with the main script.

+1  

I never understood why an add-on needed to use message passing to talk to its own internal add-on pages (since there's not the same security concerns with internal html files, although I guess an internal html page might embed potentially risky external content somehow?). So anything to streamline this makes sense to me.

-Paul

ZER0

unread,
Oct 3, 2012, 3:19:27 AM10/3/12
to mozilla-la...@googlegroups.com
On Wed Oct 3 05:18:07 2012, Paul Morris wrote:

>> So I'd love a simple, opinionated module that manages an addon page
>> and its communication with the main script.
>
> +1
>
> I never understood why an add-on needed to use message passing to talk
> to its own internal add-on pages (since there's not the same security
> concerns with internal html files, although I guess an internal html
> page might embed potentially risky external content somehow?).

That's true, this is why we added `addon` property:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/widget.html
(see "Scripting Trusted Widget Content").

Using `addon` you don't need to have content scripts for trusted pages.

The Addon Page should have the same property – that was the original
plan – but wasn't implemented – and it's waiting to be implemented,
it's in the todo list.

In general we use message passing not only because security, but also
to avoid synchronous operation, that couldn't be done easily in case
the content script and the add-on script are running on different
processes.

Paul Morris

unread,
Oct 3, 2012, 8:26:34 AM10/3/12
to mozilla-la...@googlegroups.com
On Oct 3, 2012, at 3:19 AM, ZER0 <ze...@mozilla.com> wrote:

On Wed Oct  3 05:18:07 2012, Paul Morris wrote:

So I'd love a simple, opinionated module that manages an addon page
and its communication with the main script.

+1

I never understood why an add-on needed to use message passing to talk
to its own internal add-on pages (since there's not the same security
concerns with internal html files, although I guess an internal html
page might embed potentially risky external content somehow?).

That's true, this is why we added `addon` property:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/widget.html
(see "Scripting Trusted Widget Content").

Using `addon` you don't need to have content scripts for trusted pages.

Ok, I see, so for trusted pages you would use a page script instead of a content script.  But page scripts still use the same message passing APIs to communicate with the main script:

"Like a content script, these [page] scripts can communicate with the add-on code using the postMessage() API or the port API. The crucial difference is that these scripts access thepostMessage and port objects through the addon object, whereas content scripts access them through the self object."

I guess from my perspective as an amateur SDK user, this just seems like a different way to attach a script to a page, but once attached it basically works the same, so you're still passing messages back and forth with trusted content...  

But maybe I'm missing something, or maybe this is just to avoid a synchronous operation like you mentioned?  (This is for the possible future telemetry thing, right?)  


The Addon Page should have the same property – that was the original
plan – but wasn't implemented – and it's waiting to be implemented,
it's in the todo list.

Sounds good.  Thanks for the help with understanding all this.

-Paul


In general we use message passing not only because security, but also
to avoid synchronous operation, that couldn't be done easily in case
the content script and the add-on script are running on different
processes.

Reply all
Reply to author
Forward
0 new messages