Skip to content

Commit

Permalink
Assume any documentUrl that ends with .js is a SW.
Browse files Browse the repository at this point in the history
Service worker requests seem to be the only case where
details.documentUrl contains a non-trivial path.

This needs to be confirmed.
  • Loading branch information
ghostwords committed Oct 21, 2018
1 parent 8e526d1 commit 211de76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function getDocumentHostForRequest(details) {
}
} else {
// TODO Firefox 54-57 or a service worker request
if (details.documentUrl.endsWith("/sw.js")) {
if (new URL(details.documentUrl).pathname.endsWith(".js")) {
url = details.documentUrl;
}
}
Expand Down

0 comments on commit 211de76

Please sign in to comment.