Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 21:06:08 - kermiee [[email protected]] entered the room.
- 21:06:35 - kermiee: I not get any answer at this channel yet, but maybe something will happen
- 21:08:35 - kermiee: runner.js loads the main.js
- 21:08:43 - kermiee: / this is where the addon's main.js finally run. let program = main(options.loader, options.main);
- 21:08:54 - kermiee: where is context of main.js?
- 21:10:29 - kermiee: i understand that main() convert main.js into function and then this function execute in line
- 21:10:34 - kermiee: program.main({ loadReason: loadReason, staticArgs: staticArgs },{})
- 21:11:01 - kermiee: how to get access to context of main.js?
- 21:12:46 - kermiee: loader.js so complicated that i never will find answer in there
- 21:19:31 - kermiee: thanks god I found, probably it is sandbox = new loader.sharedGlobalSandbox.Object();
- 21:20:36 - kermiee: I love jetpack so much, you have great comments around any code' line. Unlike mozilla
- 21:28:29 - chrisccoulson_ [[email protected]] entered the room.
- 21:32:59 - jsantell: kermiee: access to it from where
- 22:00:22 - kermiee: jsantell, from runner.js or any other sdk file
- 22:00:31 - kermiee: at start of addon
- 22:00:42 - kermiee: so i think runner.js my best variant
- 22:01:11 - jsantell: kermiee: look at the loader tests, they load up a main file and access the scope
- 22:01:16 - jsantell: test/test-loader.js priobably
- 22:06:05 - kermiee: also
- 22:06:17 - kermiee: main.js context have eval
- 22:06:26 - kermiee: but I not see where it declared
- 22:06:44 - kermiee: eval is sandbox specified function?
- 22:06:56 - kermiee: i mean every sandbox have eval?
- 22:10:31 - jsantell: kermiee: its part of JS, it should
- 22:14:22 - kermiee: and how can i debug sdk?
- 22:14:49 - kermiee: it have any arguments for cfx/jpm to show sdk console.log in console?
- 22:16:07 - jsantell: kermiee: should show up in stdout
- 22:21:25 - kermiee: kermiee, thanks you sir, you was very helpfull
- 22:26:30 - kermiee has left the room (Quit: http://www.mibbit.com ajax IRC Client).
- 22:28:13 - forgetname [[email protected]] entered the room.
- 22:28:19 - forgetname: i forget my previous name
- 22:28:26 - forgetname: i have one more question
- 22:28:36 - forgetname: runner.js have console
- 22:28:42 - forgetname: but loader.js not have console
- 22:28:52 - forgetname: how to implement console in loader.js
- 22:34:31 - forgetname: ok i made it
- 22:34:33 - forgetname: thanks:3
- 22:34:37 - forgetname has left the room (Quit: http://www.mibbit.com ajax IRC Client).
- 23:11:43 - forgetname [[email protected]] entered the room.
- 23:12:06 - forgetname: jetpack you are amazing;3 i made it better than planed at start
- 23:14:03 - forgetname: maybe i cant do it even better?
- 23:14:40 - forgetname: have you idea how to declare string variable in c++ and get it from addonsdk?
- 23:40:09 - forgetname: i changed my mind
- 23:40:28 - forgetname: Message: Error: Module: addonid/main has no authority to load: chrome
- 23:40:59 - jsantell: require("chrome")
- 23:41:04 - forgetname: it happen when i did Cu.evalInSandbox(mysource, sandbox, version, uri, line)
- 23:41:44 - forgetname: i move source from main.js to this string
- 23:43:03 - forgetname: i not understand why
- 23:43:41 - forgetname: it same function which load main.js
- 23:44:28 - forgetname: ok it was return source ? Cu.evalInSandbox(source, sandbox, version, uri, line) : loadSubScript(uri, sandbox, encoding);
- 23:44:50 - forgetname: evalinSanbox for sources and loadSubScript for uri
- 23:45:11 - forgetname: evalinSandbox works great, but cant use require, why?
- 23:45:39 - jsantell: You need to get Cu via chrome module
- 23:45:44 - jsantell: require("chrome").Cu.evalInSandbox
- 23:45:54 - forgetname: no, you not understand
- 23:46:04 - forgetname: this error not from loader.js
- 23:46:05 - jsantell: im not sure what you're trying to do
- 23:46:33 - forgetname: this error from main.js sandbox. it happen inside Cu.evalInSandbox(source, sandbox, version, uri, line)
- 23:47:05 - forgetname: source have many requires(''), and it not have authority to load it
- 23:47:11 - jsantell: what source?
- 23:47:14 - jsantell: what are you trying to evaluate in a sandbox
- 23:47:36 - forgetname: i have extension, it have main.js
- 23:47:44 - forgetname: i want to move code from main.js to loader.js
- 23:47:55 - forgetname: and execute it before main.js source
- 23:47:56 - jsantell: what is loader.js
- 23:48:06 - jsantell: are you editing files after building with cfx/jpm?
- 23:48:13 - forgetname: loader.js is module for loading modules
- 23:48:38 - forgetname: fox example loader.js load and execute main.js
- 23:48:45 - jsantell: why do you want to do this?
- 23:49:02 - forgetname: i want to hide code of my main.js to prevent debug
- 23:50:03 - forgetname: so basically my question is why Cu.evalInSandbox not have access to requires and how to allow it
- 23:52:42 - jsantell: because the sandbox doesnt have require
- 23:52:48 - jsantell: you'd have to instantiate your own loader
- 23:52:57 - jsantell: but not sure why you'd want to prevent debugging in the first place
- 23:55:14 - forgetname: because if you single developer and you have some not so smart competitors with aggressive marketing, you need to protect yourself
- 23:56:07 - forgetname: but error is not "requires is not defined" but "has no authority to load: modulename"
- 23:56:26 - forgetname: so it have requires but not have access
- 00:46:19 - jsantell: forgetname: im not sure, but all addons are in JS and there's no way to truly compile it
- 00:47:00 - forgetname: now i just want to use require in sandbox
- 00:47:16 - forgetname: without "has no authority to load: modulename"
- 00:50:34 - forgetname: everytime that developer of product says that something impossible in his product it make me sad
- 00:51:58 - forgetname: DoLoadSubScriptWithOptions read script from file and eval it in context. just put it there as string and it will be compiled
- 00:52:40 - forgetname: i just not familiar with firefox classes and I need much more time for change it
- 00:56:01 - forgetname: problem of this error described in cuddlefish
- 00:56:04 - forgetname: / If requirer entry is in manifest and it's requirement is not, than // it has no authority to load since linker was not able to find it.
- 00:57:07 - forgetname: so evalInSandbox looking for modules not in my extension dir but in /loader dir
- 01:03:58 - jsantell: there not being a true way to compile js is the nature of client side languages
- 01:04:22 - jsantell: jpm gets around not needing compile time paths to modules
- 01:04:27 - jsantell: cfx needs it at compile time
- 01:04:50 - jsantell: but you're just turning a string into a sandbox, that's still observable by someone looking at the source
- 01:04:57 - forgetname: its not about compile
- 01:05:00 - forgetname: how?
- 01:05:09 - jsantell: you could save yourself a lot of trouble and just minify the code before shipping the xpi
- 01:05:25 - forgetname: you joke me, I deobfuscate js code in days
- 01:06:02 - forgetname: it same as put it in plain text
- 01:06:05 - jsantell: right
- 01:06:11 - jsantell: how is making it a string better?
- 01:06:23 - forgetname: if i put my string in c++ code of firefox
- 01:06:34 - forgetname: and call c++ function for evalute js in context
- 01:06:37 - jsantell: well sure if you're shipping binaries
- 01:06:44 - forgetname: how someone can see my js?
- 01:06:53 - forgetname: i shipping binaries
- 01:07:15 - jsantell: if you're evaluating JS on my machine, i can see it
- 01:07:21 - forgetname: yes i know:)
- 01:07:24 - jsantell: ok
- 01:07:30 - forgetname: but i need variant for binaries
- 01:08:02 - forgetname: but it take a long time to make it, so now i just want to evalInSanbox with requires
- 01:14:44 - forgetname: I just know that problem can be solved in one string, but main problem in every firefox question its to find someone who know how it work
- 01:15:12 - forgetname: so anytime i need to waste a weeks for one string :c
- 01:22:41 - forgetname: I make it work, but it is really not clear
- 01:22:53 - forgetname: i not understand how work thing that I did
- 01:23:30 - forgetname: i changed all pathes of local modules in my extension to global like resource://jid1-moduleid/modulename/lib/
- 01:23:58 - forgetname: and it still throw error on chrome, so i just disabled this throw in cuddlefish and it is work great
- 01:25:49 - forgetname: only god know how it work
Advertisement
Add Comment
Please, Sign In to add comment