Ticket #91 (reopened defect)

Opened 8 months ago

Last modified 3 months ago

calling an object constr method in target file causes problems

Reported by: junkvendorema..@yahoo.com Assigned to:
Priority: major Milestone:
Version: Keywords: wontfix-vote
Cc:

Description

FF3 beta4

i've got the following function in the target file

function test() { this.x = 1; }

calling "new unsafeWindow.test()" in my gm script file, causes "not enough arguments" error message in the browser's error console and stops.

Attachments

Change History

06/04/08 08:56:47 changed by bankruptcy

Nice Site! http://google.com

06/18/08 19:12:39 changed by aranti..@gmail.com

  • keywords set to wontfix-vote.

Given security restrictions, I don't think this sort of thing will ever work.

(follow-up: ↓ 4 ) 06/19/08 09:43:38 changed by boo..@youngpup.net

  • status changed from new to closed.
  • resolution set to worksforme.

WFH:

page: <script> function test() { this.x = 1; alert('hi'); } </script>

script: unsafeWindow.test();

(in reply to: ↑ 3 ) 06/19/08 09:50:48 changed by aranti..@gmail.com

Replying to boo..@youngpup.net:

script: unsafeWindow.test();

The description does not ask to be able to call the function "test" but rather to create the object "test": "new unsafeWindow.test()"

08/08/08 06:29:43 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

as aranti said. Calling the function works but does not create an object. The proper attempt to do this would be:

page: <script> function test() { this.x = 1; alert('hi'); } </script>

script: var x = new unsafeWindow.test();

If it's a "won't be fixed" for the reason mentioned by aranti, then it should be closed indicating that.

08/08/08 06:33:52 changed by anonymous

I should note that a workaround would be to load the script within the GM script's context, by use of GM_xmlhttpRequest and eval. I should also note that I'm having issues trying to use that technique and still be able to use GM_xmlhttpRequest later on after the script loads, though.


Add/Change #91 (calling an object constr method in target file causes problems)