Visit Mozilla.org

Talk:Bypassing Security Restrictions and Signing Code

From MDC

When an interpreter leaves the method that has switched privileges on, it automatically reverts the privileges (at least to my knowledge and experience). The problem occurs when you use threads (using window.setInterval()) ... First thread that leaves your run() method causes the privileges to be revoked, so the remaining/running threads crash on "permission denied". :o/

As there's nothing like sleep() that would allow threads in JS to wait for each other, one simply can't use threads for things that require the extended privileges. (I don't see busy-loops to be a solution as they do slow-down browser pretty much, which turns use of threads to be meaningless.)

setInterval doesn't use threads... --Biesi 16:10, 16 September 2005 (PDT)

Do you mean one can't hurry-up things by dividing work among several setInterval-launched methods as they still don't run concurrently? (I haven't used this in a way I could claim it proves "threads" to be working, so I really mean my question. :o)

update: I've made a test for myself and I see you're right Biesi :o/ Should I delete this conversation (as the whole question is kinda out-of-sense now)?

I dunno, maybe the note that setInterval-called functions don't have the privileges anymore might still be useful to readers? --Biesi 10:03, 20 September 2005 (PDT)