freaktechnik

Untitled

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