Difference between revisions of "UnsafeWindow"

From GreaseSpot Wiki
Jump to navigationJump to search
(security template)
Line 12: Line 12:


  unsafeWindow.document.title="Testing"
  unsafeWindow.document.title="Testing"
  unsafeWindow.TestVarCreatedByDocument="Testing"
  unsafeWindow.TestVarCreatedByDocument="Testing"
  unsafeWindow.document.TestFunction("Test")
  unsafeWindow.document.TestFunction("Test")

Revision as of 09:26, 6 November 2006

This command can open certain security holes in your user script, and it is recommended to use this command sparingly.

Please be sure to read the entire article and understand it before using it in a script.


Syntax

unsafeWindow

Description

Userscripts can use this object to access document functions, variables and other elements in the document. unsafeWindow is a object wrapper for the entire document object.

Examples

unsafeWindow.document.title="Testing"
unsafeWindow.TestVarCreatedByDocument="Testing"
unsafeWindow.document.TestFunction("Test")