surrogate quick reference

Bug reports and enhancement requests

surrogate quick reference

Postby al_9x » Thu Sep 29, 2011 1:02 am

  • no prefix - blocked script surrogate
    • matches blocked scripts
    • runs only if page is script allowed
    • runs when the blocked matched script would have
  • '<' - before script surrogate
    • matches allowed scripts
    • runs only if page and script are allowed
    • runs just before the matched script executes
  • '>' - after script surrogate.
    • matches allowed scripts
    • runs only if page and script are allowed
    • runs just after (load event) the matched script executes
  • '@' - script allowed page (html document) surrogate
    • matches script allowed pages
    • runs only if the page is script allowed
    • runs before HTML parsing starts
  • '!' - script blocked page surrogate
    • matches script blocked pages
    • runs only if the page is script blocked
    • runs on DOMContentLoaded
  • '!@' - page surrogate
    • matches pages
    • runs on both script allowed and script blocked pages
    • runs on DOMContentLoaded

References: 1, 2, 3, 4

Additional notes:

  • Surrogates are never executed in global lexical scope, some are wrapped in functions, others in blocks, so variables declared with "let" are always private to the surrogate.
Last edited by al_9x on Thu Dec 01, 2011 9:07 pm, edited 1 time in total.
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
al_9x
Master Bug Buster
 
Posts: 912
Joined: Thu Mar 19, 2009 4:52 pm

Re: surrogate quick reference

Postby Giorgio Maone » Thu Sep 29, 2011 9:41 am

Well done, thank you.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 7328
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy


Return to NoScript Development

Who is online

Users browsing this forum: No registered users and 6 guests