While it's not advertised in the announcement, it's possible to use
Jetpack SDK with regular (XUL) extensions, which is useful if you want
to use the "modules" functionality or planning to switch to Jetpack
incrementally.
http://asqueella.blogspot.com/2010/03/jetpack-sdk-and-xul-extensions.html
Thought it might be interesting to old-time developers watching the
Jetpack effort.
Nickolay
Error: directory not found: C:\Documents and Settings\grbradt
\Application Data\Mozilla\Firefox\Profiles\tmc20g12.jetpack\extensions
\simpl...@grbradt.org\resources\ace682b1-aefe-4d86-
a392-4067cbf46340-simpletimer-tests
Source file:
file:///C:/Documents%20and%20Settings/grbradt/Application%20Data/Mozilla/Firefox/Profiles/tmc20g12.jetpack/extensions/simpl...@grbradt.org/components/harness.js
Line: 107
My resources folder contains only ...jetpack-core-lib
and ...simpletimer-lib directories.
(My tests folder created in step 6 is empty)
Any idea what the problem is?
Running Win XP and Fx 3.6.2
Thanks,
George
On Mar 28, 4:44 pm, Nickolay Ponomarev <asquee...@gmail.com> wrote:
> Hi,
>
> While it's not advertised in the announcement, it's possible to use
> Jetpack SDK with regular (XUL) extensions, which is useful if you want
> to use the "modules" functionality or planning to switch to Jetpack
> incrementally.
>
> http://asqueella.blogspot.com/2010/03/jetpack-sdk-and-xul-extensions....
By the way, Nickolay, this is an excellent guide! Would you be
interested in possibly contributing it as one of the appendices in the SDK?
- Atul
Regards,
George
On Mar 29, 12:52 am, Atul Varma <ava...@mozilla.com> wrote:
> Oh, the test directory isn't actually included in built XPIs--it's only
> available when you use 'cfx test', which effectively adds the test
> directory and some other stuff. We could add a command-line switch for
> including the tests, though... Does using 'cfx test' work for your use case?
>
> By the way, Nickolay, this is an excellent guide! Would you be
> interested in possibly contributing it as one of the appendices in the SDK?
>
> - Atul
>
> On 3/28/10 9:35 PM, grbradt wrote:
>
> > Hi,
> > I tried this with one of my own extensions, and worked nicely, thanks!
> > However, when I tried to install and use the .xpi from step 8, I got
> > the following error in the console:
>
> > Error: directory not found: C:\Documents and Settings\grbradt
> > \Application Data\Mozilla\Firefox\Profiles\tmc20g12.jetpack\extensions
> > \simpleti...@grbradt.org\resources\ace682b1-aefe-4d86-
> > a392-4067cbf46340-simpletimer-tests
> > Source file:
> > file:///C:/Documents%20and%20Settings/grbradt/Application%20Data/Mozilla/Firefox/Profiles/tmc20g12.jetpack/extensions/simpleti...@grbradt.org/components/harness.js
By the way, Nickolay, this is an excellent guide! Would you be interested in possibly contributing it as one of the appendices in the SDK?
we can use CommonJS modules from regular extension code using this
code:
function loadJetpackModule(module) {
return Components.classes[
"@mozilla.org/harness-service;1?id=te...@example.com"].
getService().wrappedJSObject.loader.require(module);
}
alert(loadJetpackModule("my-module").add(1, 3)); // alerts 4!
however, if i try to use the same code inside the extension, it get
stuck and does not do anything, let alone printing the alert with '4'.
I have tried with two small extension, web2pdf and commentblocker but
faced the same problem. No error message is printed either in the
terminal or console, so could not figure out the root cause of the
problem. Any help will be appreciated.
we can use CommonJS modules from regular extension code using this
code:
[...]
however, if i try to use the same code inside the extension, it get
stuck
alert(loadJetpackModule("my-module").add(1, 3));
however after this modification, nothing happens and it gets stuck over there.
Nickolay
--
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.
Working scenario:
If i paste the code in the error console as suggested by the sdk documentation, it works fine and shows an alert box with summation result 4.
Failing scenario:
The normal web2pdf JSE works in this way, you have to open a page and click the icon, then the 3rd party web page is opened in a separate tab which converts the web page to a pdf.
I am trying to convert it to Jetpack. I used the same code for invoking a jetpack module inside web2pdf extension code in web2pdf.js file and modified the code such that now the loadJetpackModule is a function declared inside the .js file. Now whenever a button is clicked the following line will be executed and then the document will be converted to pdf by the 3rd party web page opened in a separte page..
however after this modification, nothing happens and it gets stuck over there.alert(loadJetpackModule("my-module").add(1, 3));
By "console" you mean Tools>Error Console, right? And you have the dev prefs <https://developer.mozilla.org/en/Setting_up_extension_development_environment#Development_preferences> set, javascript.options.showInConsole = true in particular?On Thu, May 27, 2010 at 2:20 AM, Rezwana Karim Nawrin <rezwana.k...@gmail.com> wrote:
Working scenario:
If i paste the code in the error console as suggested by the sdk documentation, it works fine and shows an alert box with summation result 4.OK, this means the component is registered and is functioning normally.
Failing scenario:
The normal web2pdf JSE works in this way, you have to open a page and click the icon, then the 3rd party web page is opened in a separate tab which converts the web page to a pdf.
I am trying to convert it to Jetpack. I used the same code for invoking a jetpack module inside web2pdf extension code in web2pdf.js file and modified the code such that now the loadJetpackModule is a function declared inside the .js file. Now whenever a button is clicked the following line will be executed and then the document will be converted to pdf by the 3rd party web page opened in a separte page..
however after this modification, nothing happens and it gets stuck over there.alert(loadJetpackModule("my-module").add(1, 3));
Does alert(1) work? (if it doesn't, what context the JS code is loaded in? an overlay, an XPCOM component, a CommonJS module? The latter two don't have alert().
Does alert(Components.classes) work?
Are you testing this code just after you successfully run the snippet in the Error Console -- without making any changes or restarting Firefox?
Yes earlier when i wrote console ,I meant Tools->Error console. so far , javascript.options.showInConsole was set to false. I changed it true . And now the it says that loadJetpackModule function is not defined.
Does alert(1) work? (if it doesn't, what context the JS code is loaded in? an overlay, an XPCOM component, a CommonJS module? The latter two don't have alert().
I have tried with alert("hello world") . It works fine. Problem occurs when the loadJetpackModule is invoked within alert().
from this error, i think somehow it is not recognizing the loadJetpackModule function. The way i defined it in web2pdf.js file is as below.
const web2pdf = {
.............
...........
loadJetpackModule: function (module) {},
return Components.classes[
"@mozilla.org/harness-service;1?id=te...@example.com"].
getService().wrappedJSObject.loader.require(module);
onClick : function (){.....................................
alert(loadJetpackModule("my-module").add(1, 3));
},
So I'm proposing a draft of such JEP (based on my current patches and
some other thoughts):
https://wiki.mozilla.org/User:RPL/drafts/JEP_xyz_Chrome_Support
Is there anyone (besides me) interested to this sorts of JEP?
Is there any interest to merge this sorts of things?
Some other thoughts?
Happy hacking to all,
rpl
--
Luca Greco @ Alca Società Cooperativa
Follow me on http://twitter.com/lucagreco
* From the Jetpack SDK docs, localhost and online, pages:
function loadJetpackModule(module) {
return Components.classes[
"@mozilla.org/harness-service;1?id="jid0-i6WjYzrJ0UFR0pPPM7Znl3BvYbk"].
getService().wrappedJSObject.loader.require(module);
}
m
> 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.
>
>