diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-07-05 22:23:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05 22:23:02 +0200 |
commit | 52d608c670c5c485cfe1139c40ec06d8ef460a26 (patch) | |
tree | 91d27a6911b77ae9e70ca3ba64929a92d6ea14ed /dom/workers | |
parent | c3fe7f59c8b6c1a23f5ae85f0697470fad560d68 (diff) | |
parent | 3815302230bc043f98667c1ee0de6dee15969034 (diff) | |
download | UXP-52d608c670c5c485cfe1139c40ec06d8ef460a26.tar UXP-52d608c670c5c485cfe1139c40ec06d8ef460a26.tar.gz UXP-52d608c670c5c485cfe1139c40ec06d8ef460a26.tar.lz UXP-52d608c670c5c485cfe1139c40ec06d8ef460a26.tar.xz UXP-52d608c670c5c485cfe1139c40ec06d8ef460a26.zip |
Merge pull request #599 from janekptacijarabaci/dom_fetch_request_navigate_1
Added support for Request constructor with "mode: navigate"
Diffstat (limited to 'dom/workers')
-rw-r--r-- | dom/workers/test/serviceworkers/fetch_event_worker.js | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/dom/workers/test/serviceworkers/fetch_event_worker.js b/dom/workers/test/serviceworkers/fetch_event_worker.js index 1caef71e8..895128e2c 100644 --- a/dom/workers/test/serviceworkers/fetch_event_worker.js +++ b/dom/workers/test/serviceworkers/fetch_event_worker.js @@ -148,28 +148,21 @@ onfetch = function(ev) { } else if (ev.request.url.includes("navigate.html")) { - var navigateModeCorrectlyChecked = false; var requests = [ // should not throw new Request(ev.request), new Request(ev.request, undefined), new Request(ev.request, null), new Request(ev.request, {}), new Request(ev.request, {someUnrelatedProperty: 42}), + new Request(ev.request, {method: "GET"}), ]; - try { - var request3 = new Request(ev.request, {method: "GET"}); // should throw - } catch(e) { - navigateModeCorrectlyChecked = requests[0].mode == "navigate"; - } - if (navigateModeCorrectlyChecked) { - ev.respondWith(Promise.resolve( - new Response("<script>window.frameElement.test_result = true;</script>", { - headers : { - "Content-Type": "text/html" - } - }) - )); - } + ev.respondWith(Promise.resolve( + new Response("<script>window.frameElement.test_result = true;</script>", { + headers : { + "Content-Type": "text/html" + } + }) + )); } else if (ev.request.url.includes("nonexistent_worker_script.js")) { |