tor-browser

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

verify-length-module.js (498B)


      1 // Copyright 2024 The Chromium Authors
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 class VerifyLength {
      6  async run(urls, data) {
      7    if (data && data.hasOwnProperty('expectedLength')) {
      8      const expectedLength = data['expectedLength'];
      9      const actualLength = await sharedStorage.length();
     10      if (actualLength === expectedLength) {
     11        return 1;
     12      }
     13    }
     14    return -1;
     15  }
     16 }
     17 
     18 register('verify-length', VerifyLength);