tor-browser

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

GeckoViewFormValidationChild.sys.mjs (708B)


      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 { GeckoViewActorChild } from "resource://gre/modules/GeckoViewActorChild.sys.mjs";
      6 
      7 export class GeckoViewFormValidationChild extends GeckoViewActorChild {
      8  handleEvent(aEvent) {
      9    switch (aEvent.type) {
     10      case "MozInvalidForm": {
     11        // Handle invalid form submission. If we don't hook up to this,
     12        // invalid forms are allowed to be submitted!
     13        aEvent.preventDefault();
     14        // We should show the validation message, bug 1510450.
     15        break;
     16      }
     17    }
     18  }
     19 }