author James Willcox <snorp@snorp.net>
Fri, 03 Aug 2018 14:48:31 -0500
changeset 487930 6cd69a56e853b2f2f3ef42e1ef406030cfbc9c1f
parent 485567 e66e6bd82e3feffc432210642bd20d1479c58cf3
child 489836 fedb26132f9a4b3ff3ccbe0762f38db40c8c9cce
permissions -rw-r--r--
Bug 1480095 - Allow loading custom error pages via nsILoadURIDelegate r=esawin,bz,jchen MozReview-Commit-ID: IhVC9nU60fy

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "nsISupports.idl"

interface nsIURI;
interface nsIPrincipal;

 * The nsILoadURIDelegate interface.
 * Used for delegating URI loads to GeckoView's application, e.g., Custom Tabs
 * or Progressive Web Apps.
[scriptable, uuid(78e42d37-a34c-4d96-b901-25385669aba4)]
interface nsILoadURIDelegate : nsISupports
   * Delegates the URI load.
   * @param aURI The URI to load.
   * @param aWhere See possible values described in nsIBrowserDOMWindow.
   * @param aFlags Flags which control the behavior of the load.
   * @param aTriggeringPrincipal The principal that triggered the load of aURI.
   * @return A promise which can resolve to a boolean indicating whether or
   *         not the app handled the load. Rejection should be treated the same
   *         as a false resolution.
  loadURI(in nsIURI aURI, in short aWhere, in long aFlags,
          in nsIPrincipal aTriggeringPrincipal);

   * Delegates page load error handling.
   * @param aURI The URI that failed to load.
   * @param aError The error code.
   * @param aErrorModule The error module code.

   * Returns an error page URL to load, or null to show the default error page.
   * No error page is shown at all if an error is thrown.
  handleLoadError(in nsIURI aURI, in nsresult aError, in short aErrorModule);