Variable sandboxConst

sandbox: Readonly<{
    alert: ((message?) => void);
    dateRange: (() => boolean);
    dnsDomainIs: ((host, domain) => boolean);
    dnsDomainLevels: ((host) => number);
    dnsResolve: ((host) => Promise<string | null>);
    isInNet: ((host, pattern, mask) => Promise<boolean>);
    isPlainHostName: ((host) => boolean);
    isResolvable: ((host) => Promise<boolean>);
    localHostOrDomainIs: ((host, hostdom) => boolean);
    myIpAddress: (() => Promise<string>);
    shExpMatch: ((str, shexp) => boolean);
    timeRange: (() => boolean);
    weekdayRange: ((wd1, wd2?, gmt?) => boolean);
}> = ...

Type declaration

  • alert: ((message?) => void)
      • (message?): void
      • Parameters

        • message: string = ''

        Returns void

  • dateRange: (() => boolean)
      • (): boolean
      • If only a single value is specified (from each category: day, month, year), the function returns a true value only on days that match that specification. If both values are specified, the result is true between those times, including bounds.

        Even though the examples don't show, the "GMT" parameter can be specified in any of the 9 different call profiles, always as the last parameter.

        Examples:

        dateRange(1)
        true on the first day of each month, local timezone.

        dateRange(1, "GMT")
        true on the first day of each month, GMT timezone.

        dateRange(1, 15)
        true on the first half of each month.

        dateRange(24, "DEC")
        true on 24th of December each year.

        dateRange(24, "DEC", 1995)
        true on 24th of December, 1995.

        dateRange("JAN", "MAR")
        true on the first quarter of the year.

        dateRange(1, "JUN", 15, "AUG")
        true from June 1st until August 15th, each year (including June 1st and August
        15th).

        dateRange(1, "JUN", 15, 1995, "AUG", 1995)
        true from June 1st, 1995, until August 15th, same year.

        dateRange("OCT", 1995, "MAR", 1996)
        true from October 1995 until March 1996 (including the entire month of October
        1995 and March 1996).

        dateRange(1995)
        true during the entire year 1995.

        dateRange(1995, 1997)
        true from beginning of year 1995 until the end of year 1997.

        dateRange(day) dateRange(day1, day2) dateRange(mon) dateRange(month1, month2) dateRange(year) dateRange(year1, year2) dateRange(day1, month1, day2, month2) dateRange(month1, year1, month2, year2) dateRange(day1, month1, year1, day2, month2, year2) dateRange(day1, month1, year1, day2, month2, year2, gmt)

        Returns boolean

  • dnsDomainIs: ((host, domain) => boolean)
      • (host, domain): boolean
      • Returns true iff the domain of hostname matches.

        Examples:

        dnsDomainIs("www.netscape.com", ".netscape.com")
        // is true.

        dnsDomainIs("www", ".netscape.com")
        // is false.

        dnsDomainIs("www.mcom.com", ".netscape.com")
        // is false.

        Parameters

        • host: string

          is the hostname from the URL.

        • domain: string

          is the domain name to test the hostname against.

        Returns boolean

        true iff the domain of the hostname matches.

  • dnsDomainLevels: ((host) => number)
      • (host): number
      • Returns the number (integer) of DNS domain levels (number of dots) in the hostname.

        Examples:

        dnsDomainLevels("www")
        // returns 0.
        dnsDomainLevels("www.netscape.com")
        // returns 2.

        Parameters

        • host: string

          is the hostname from the URL.

        Returns number

        number of domain levels

  • dnsResolve: ((host) => Promise<string | null>)
      • (host): Promise<string | null>
      • Resolves the given DNS hostname into an IP address, and returns it in the dot separated format as a string.

        Example:

        dnsResolve("home.netscape.com")
        // returns the string "198.95.249.79".

        Parameters

        • host: string

          hostname to resolve

        Returns Promise<string | null>

        resolved IP address

  • isInNet: ((host, pattern, mask) => Promise<boolean>)
      • (host, pattern, mask): Promise<boolean>
      • True iff the IP address of the host matches the specified IP address pattern.

        Pattern and mask specification is done the same way as for SOCKS configuration.

        Examples:

        isInNet(host, "198.95.249.79", "255.255.255.255")
        // is true iff the IP address of host matches exactly 198.95.249.79.

        isInNet(host, "198.95.0.0", "255.255.0.0")
        // is true iff the IP address of the host matches 198.95.*.*.

        Parameters

        • host: string

          a DNS hostname, or IP address. If a hostname is passed, it will be resoved into an IP address by this function.

        • pattern: string

          an IP address pattern in the dot-separated format mask.

        • mask: string

          for the IP address pattern informing which parts of the IP address should be matched against. 0 means ignore, 255 means match.

        Returns Promise<boolean>

  • isPlainHostName: ((host) => boolean)
      • (host): boolean
      • True iff there is no domain name in the hostname (no dots).

        Examples:

        isPlainHostName("www")
        // is true.

        isPlainHostName("www.netscape.com")
        // is false.

        Parameters

        • host: string

          The hostname from the URL (excluding port number).

        Returns boolean

  • isResolvable: ((host) => Promise<boolean>)
      • (host): Promise<boolean>
      • Tries to resolve the hostname. Returns true if succeeds.

        Parameters

        • host: string

          is the hostname from the URL.

        Returns Promise<boolean>

  • localHostOrDomainIs: ((host, hostdom) => boolean)
      • (host, hostdom): boolean
      • Is true if the hostname matches exactly the specified hostname, or if there is no domain name part in the hostname, but the unqualified hostname matches.

        Examples:

        localHostOrDomainIs("www.netscape.com", "www.netscape.com")
        // is true (exact match).

        localHostOrDomainIs("www", "www.netscape.com")
        // is true (hostname match, domain not specified).

        localHostOrDomainIs("www.mcom.com", "www.netscape.com")
        // is false (domain name mismatch).

        localHostOrDomainIs("home.netscape.com", "www.netscape.com")
        // is false (hostname mismatch).

        Parameters

        • host: string

          the hostname from the URL.

        • hostdom: string

          fully qualified hostname to match against.

        Returns boolean

  • myIpAddress: (() => Promise<string>)
      • (): Promise<string>
      • Returns the IP address of the host that the Navigator is running on, as a string in the dot-separated integer format.

        Example:

        myIpAddress()
        // would return the string "198.95.249.79" if you were running the
        // Navigator on that host.

        Returns Promise<string>

        external IP address

  • shExpMatch: ((str, shexp) => boolean)
      • (str, shexp): boolean
      • Returns true if the string matches the specified shell expression.

        Actually, currently the patterns are shell expressions, not regular expressions.

        Examples:

        shExpMatch("http://home.netscape.com/people/ari/index.html", "*/ari/*")
        // is true.

        shExpMatch("http://home.netscape.com/people/montulli/index.html", "*/ari/*")
        // is false.

        Parameters

        • str: string

          is any string to compare (e.g. the URL, or the hostname).

        • shexp: string

          is a shell expression to compare against.

        Returns boolean

        true if the string matches the shell expression.

  • timeRange: (() => boolean)
      • (): boolean
      • True during (or between) the specified time(s).

        Even though the examples don't show it, this parameter may be present in each of the different parameter profiles, always as the last parameter.

        Examples:

        timerange(12)
        true from noon to 1pm.

        timerange(12, 13)
        same as above.

        timerange(12, "GMT")
        true from noon to 1pm, in GMT timezone.

        timerange(9, 17)
        true from 9am to 5pm.

        timerange(8, 30, 17, 00)
        true from 8:30am to 5:00pm.

        timerange(0, 0, 0, 0, 0, 30)
        true between midnight and 30 seconds past midnight.

        timeRange(hour) timeRange(hour1, hour2) timeRange(hour1, min1, hour2, min2) timeRange(hour1, min1, sec1, hour2, min2, sec2) timeRange(hour1, min1, sec1, hour2, min2, sec2, gmt)

        Returns boolean

  • weekdayRange: ((wd1, wd2?, gmt?) => boolean)
      • (wd1, wd2?, gmt?): boolean
      • Only the first parameter is mandatory. Either the second, the third, or both may be left out.

        If only one parameter is present, the function yeilds a true value on the weekday that the parameter represents. If the string "GMT" is specified as a second parameter, times are taken to be in GMT, otherwise in local timezone.

        If both wd1 and wd1 are defined, the condition is true if the current weekday is in between those two weekdays. Bounds are inclusive. If the "GMT" parameter is specified, times are taken to be in GMT, otherwise the local timezone is used.

        Valid "weekday strings" are:

        SUN MON TUE WED THU FRI SAT
        

        Examples:

        weekdayRange("MON", "FRI")
        true Monday trhough Friday (local timezone).

        weekdayRange("MON", "FRI", "GMT")
        same as above, but GMT timezone.

        weekdayRange("SAT")
        true on Saturdays local time.

        weekdayRange("SAT", "GMT")
        true on Saturdays GMT time.

        weekdayRange("FRI", "MON")
        true Friday through Monday (note, order does matter!).

        Parameters

        • wd1: Weekday

          one of the weekday strings.

        • Optional wd2: "GMT" | Weekday

          one of the weekday strings.

        • Optional gmt: "GMT"

          is either the string: GMT or is left out.

        Returns boolean

Generated using TypeDoc