tor-browser

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

sessiondataupdate.sys.mjs (866B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
      6 
      7 class SessionDataUpdateModule extends Module {
      8  #sessionDataUpdates;
      9 
     10  constructor(messageHandler) {
     11    super(messageHandler);
     12    this.#sessionDataUpdates = [];
     13  }
     14 
     15  destroy() {}
     16 
     17  /**
     18   * Commands
     19   */
     20 
     21  _applySessionData(params) {
     22    const filteredSessionData = params.sessionData.filter(item =>
     23      this.messageHandler.matchesContext(item.contextDescriptor)
     24    );
     25    this.#sessionDataUpdates.push(filteredSessionData);
     26  }
     27 
     28  getSessionDataUpdates() {
     29    return this.#sessionDataUpdates;
     30  }
     31 }
     32 
     33 export const sessiondataupdate = SessionDataUpdateModule;