开发者

How can i call an existing javascript function in greasemonkey? [duplicate]

开发者 https://www.devze.com 2023-02-01 06:46 出处:网络
This question already has answers here: 开发者_开发问答 Closed 10 years ago. Possible Duplicate: javascript: call an embedded function from a GM script
This question already has answers here: 开发者_开发问答 Closed 10 years ago.

Possible Duplicate:

javascript: call an embedded function from a GM script

i'm trying to write a script that will select all friends in the xbox.com message center in order to send a M2AF (message to all friends) without having to manually select all of them.

Compose.ToggleFriend('friend1')

when run in the url bar (prefixed by javascript: of course) this selects friend1 perfectly.

but when i try to implement this into a greasemonkey script it just won't work for some reason.


Use this:

unsafeWindow.Compose.ToggleFriend('friend1');

unsafeWindow points in GM onto the global window-object.

0

精彩评论

暂无评论...
验证码 换一张
取 消