DocStartInjection: bound execute() with a deadline to avoid permanent hangs - #13
Conversation
|
Is this a fix for that issue, or does it just paper over the symptom? nscl is not only for NoScript. Should the timeout be optional for the extension to decide whether it wants it or not? Will this timeout risk stopping security-related scripts before they get to do their job, thereby creating a security hole? Deadlocking might actually be safer than terminating in that case.. Note that the Firefox bug you linked is about CSS, not Javascript, and does not appear to be adding a time deadline. |
|
@laniakea64 Thanks for the feedback. This was intended as a temporary workaround rather than a root-cause fix. I have confirmed a case where Firefox Bug 1900222 also mentions in Comment 7 that
This timeout only limits how long we wait for the I also hadn't realized that NSCL is used by extensions other than NoScript. |
Fixes 596.
Adds a timeout to
DocStartInjectionas a safeguard against cases where script execution never settles.Firefox previously had a similar issue (Bug 1900222), in which the Promise returned by
scripting.executeScript()could remain pending indefinitely instead of resolving or rejecting. A similar failure mode appears to be occurring here.The timeout prevents
DocStartInjectionfrom remaining blocked indefinitely. Because the pending operation cannot be canceled, a timed-out call is not retried, avoiding the accumulation of unresolved operations.I have only confirmed this behavior on Firefox so far, so please consider this PR a draft for now.