tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

import-globals-from.rst (695B)


      1 import-globals-from
      2 ===================
      3 
      4 Parses a file for globals defined in various unique Mozilla ways.
      5 
      6 When a ``/* import-globals-from <path> */`` comment is found in a file, then all
      7 globals from the file at <path> will be imported in the current scope. This will
      8 also operate recursively.
      9 
     10 This is useful for scripts that are loaded as <script> tag in a window and rely
     11 on each other's globals.
     12 
     13 If <path> is a relative path, then it must be relative to the file being
     14 checked by the rule.
     15 
     16 Note: ``import-globals-from`` does not support loading globals from ES modules.
     17 These should be imported as variable definitions directly, or the file where
     18 they are imported should be referenced.