tor-browser

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

WebDriverDocumentInsertedParent.sys.mjs (963B)


      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 const lazy = {};
      6 
      7 ChromeUtils.defineESModuleGetters(lazy, {
      8  notifyNavigationCommitted:
      9    "chrome://remote/content/shared/NavigationManager.sys.mjs",
     10 });
     11 
     12 export class WebDriverDocumentInsertedParent extends JSProcessActorParent {
     13  async receiveMessage(message) {
     14    const { data, name } = message;
     15 
     16    const payload = {
     17      contextDetails: data.contextDetails,
     18      url: data.url,
     19    };
     20 
     21    switch (name) {
     22      case "WebDriverDocumentInsertedChild:documentInserted": {
     23        if (data.contextDetails.isContent) {
     24          // There are no navigations in the parent process.
     25          lazy.notifyNavigationCommitted(payload);
     26        }
     27 
     28        break;
     29      }
     30      default:
     31        throw new Error("Unsupported message:" + name);
     32    }
     33  }
     34 }