Open Bug 1826174 Opened 2 years ago Updated 2 years ago

[DNR] Add test case for service worker redirect in DNR

Categories

(WebExtensions :: Request Handling, task, P3)

task

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

Bug 1636629 added special code in WebRequest.jsm (verifyRedirect) that prevents extensions from trying to redirect service workers and restrictions for redirects of importScripts calls in service workers.

This check is not strictly required: if an extension redirects a service worker, then the redirect will be rejected anyway. Similarly, if the destination is an invalid scheme, then an import is rejected. We should add a unit test for DNR-triggered SW script redirection.

Note: I'm inclined to only add a test case and not raise an explicit error from DNR. This means that DNR-triggered redirects can break service workers. This is not an issue IMO: there are other redirects (in webRequest and DNR) that can also end up in a blocked redirect, and we don't prevent that from happening either. Examples are redirect to destination that would be blocked by CSP, or blocked by SRI mismatch, etc.

Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: