Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Implement errorOccurred in the webNavigation.getFrame/getAllFrames frame details

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Request Handling
P3
normal
a year ago
10 months ago

People

(Reporter: rpl, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [webNavigation][berlin] triaged)

(Reporter)

Description

a year ago
The frame details that can be retrieved using the recently landed |webNavigation.getFrame/getAllFrames| should support an errorOccurred boolean field, from https://developer.chrome.com/extensions/webNavigation:

    boolean 	errorOccurred 	

    True if the last navigation in this frame was interrupted by an error, 
    i.e. the onErrorOccurred event fired.
(Reporter)

Comment 1

a year ago
In the initial prototype of |webNavigation.getFrame/getAllFrames|, |errorOccurred| was retrieved through the usage of the following constants:

    // NOTE: Compute the Error Page loadType value. (See Bug 1190685 for rationale)
    // - LOAD_CMD_NORMAL (as defined in "docshell/base/nsIDocShell.idl"):
    // - LOAD_FLAGS_ERROR_PAGE (as defined in "docshell/base/nsDocShellLoadTypes.h")
    // - MAKE_LOAD_TYPE (as defined in "docshell/base/nsDocShellLoadTypes.h")
    // - LOAD_ERROR_PAGE (as defined in "docshell/base/nsDocShellLoadTypes.h")
    
    const LOAD_CMD_NORMAL = Ci.nsIDocShell.LOAD_CMD_NORMAL;
    const LOAD_FLAGS_ERROR_PAGE = 0x1;
    const MAKE_LOAD_TYPE = (type, flags) => (type | (flags << 16));
    const LOAD_ERROR_PAGE = MAKE_LOAD_TYPE(LOAD_CMD_NORMAL, LOAD_FLAGS_ERROR_PAGE);

    ...
    let errorOccurred = (docShell.loadType == LOAD_ERROR_PAGE);

Unfortunately the LOAD_ERROR_PAGE constant is defined in "docshell/base/nsDocShellLoadTypes.h" and it is not exported in any of the idl files.

If exporting LOAD_ERROR_PAGE constant in the |nsIDocShell.idl| file is not an option, another strategy to build the knowledge needed to being able to populate |errorOccurred| in the frame details is keeping track of the docShells where we are already detecting and sending the |onErrorOccurred| webNavigation event in a WeakMap.

Unfortunately this strategy will work only for docShells where the error occurred after the first addon with the webNavigation permission and a subscribed webNavigation event (because it will enable the WebProgressListener in the webNavigation frame script which will keep track/untrack of the errorOccurred docShells).
(Reporter)

Updated

a year ago
Whiteboard: [webNavigation]

Comment 2

a year ago
Luca - please move higher if this is a high priority - but looked like a P3, can wait until post 48
Priority: -- → P3
Whiteboard: [webNavigation] → [webNavigation] triaged
(Reporter)

Updated

a year ago
Whiteboard: [webNavigation] triaged → [webNavigation][berlin] triaged

Updated

10 months ago
Component: WebExtensions: Untriaged → WebExtensions: Request Handling
You need to log in before you can comment on or make changes to this bug.