New issue
Advanced search Search tips

Issue 919292 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug-Regression



Sign in to add a comment

console.log(err) of DOMException prints the empty string

Reported by jonathan...@gmail.com, Jan 5

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3661.0 Safari/537.36

Steps to reproduce the problem:
1. Disable cookies on your browser.
2. Write a web-page that tries to register a service worker with a catch that logs the error message.
3. The log will be empty.

With no catch and error just appears that says:
Uncaught (in promise) 

Glitch example that reproduces the error:
https://glitch.com/edit/#!/walnut-emu?path=public/client.js:4:22

What is the expected behavior?
Firefox logs:
DOMException: "The operation is insecure."

And then logs:
Request to access cookie or storage on “https://walnut-emu.glitch.me/” was blocked because we are blocking all storage access requests.
Failed to register/update a ServiceWorker for scope ‘https://walnut-emu.glitch.me/’: Storage access is restricted in this context due to user settings or private browsing mode.

What went wrong?
I think it would be useful for an error message to be returned.
It'll make it easier to troubleshoot and notify the user.

Did this work before? N/A 

Chrome version: 73.0.3661.0  Channel: canary
OS Version: 10.0
Flash Version: 

Let me know if you need any other information or if you have trouble reproducing it.
Not sure how important it is, but it felt important at 4:00 AM.
 
Labels: Needs-Triage-M73
Components: Blink>ServiceWorker
Labels: FoundIn-73 OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac
Status: Available (was: Unconfirmed)
I made a new glitch since that walnut-emu one gave a  404 error in register().
https://crbug919292-register-error.glitch.me

This is weird, on Canary it's:
console.log(err);  // prints ''
console.log('error: ' + err);  // prints 'error: NotSupportedError: Failed to register a ServiceWorker: The user denied permission to use Service Worker.'

In Chrome 71 Stable it's:
console.log(err);  // prints 'DOMException'
console.log('error: ' + err);  // prints 'error: NotSupportedError: Failed to register a ServiceWorker: The user denied permission to use Service Worker.'

I'll run a bisect.
Cc: kozyatinskiy@chromium.org
Components: Platform>DevTools
Labels: RegressedIn-72 FoundIn-72
Owner: dgozman@chromium.org
Status: Assigned (was: Available)
Summary: console.log(err) of DOMException prints the empty string (was: The error message when registering a service worker with cookies disabled is empty)
Firefox prints:
DOMException: "The operation is insecure.
error: SecurityError: The operation is insecure.

Note that Firefox's "Storage access is restricted" message comes directly from browser, not the console.log().

I bisecting and found:
$ python tools/bisect-builds.py -a linux64 -g 599034 -b 620241 --use-local-cache -- --no-first-run --user-data-dir=/tmp/xssssss https://crbug919292-register-error.glitch.me
You are probably looking for a change made after 604627 (known good), but no later than 604629 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/d4551e74b3bc17fd56a1d83f40e547fe56984f84..d2f9d2b68e72bed57b4a46f34cfa5b5eca4d35fe

I'm suspecting the V8 roll at https://chromium-review.googlesource.com/c/1312932 (which is in 72.0.3599.0), and within that roll this CL:

inspector: move injected script source to native
https://chromium.googlesource.com/v8/v8/+/7e079c660b686d916ed5cd88bfa4ecf597300193

I'm guessing this is WAI though confusing. dgozman@ can you confirm (as kozyatinskiy seems away)? In summary where |err| is a DOMException:

  } catch(err) {
    console.log(err);
    console.log('error: ' + err);
  }

Previously the first line was 'DOMException' and the second line was 'error: NotSupportedError: Failed to register a ServiceWorker: The user denied permission...'. Now the first line is just '' but the second line is the same.


Cc: -kozyatinskiy@chromium.org dgozman@chromium.org
Owner: alph@chromium.org
alph, please take a look. We might need a merge here.

Comment 6 by falken@chromium.org, Jan 16 (6 days ago)

Components: -Blink>ServiceWorker
Removing SW as this is a not restricted to service workers. You can repro in devtools with:

console.log(new DOMException('hi'));
console.log('' + new DOMException('hi'));
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 16 (6 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/defbef78d23186c04fb0f6c741f5907d5a894766

commit defbef78d23186c04fb0f6c741f5907d5a894766
Author: Alexei Filippov <alph@chromium.org>
Date: Wed Jan 16 23:59:04 2019

[inspector] An Error with no stack description should not be empty

Make the description return the class name as it used to be.

BUG= chromium:919292 

Change-Id: Idbc07643f15014a39a08a545a5003be891d95bd3
Reviewed-on: https://chromium-review.googlesource.com/c/1416318
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58867}
[modify] https://crrev.com/defbef78d23186c04fb0f6c741f5907d5a894766/src/inspector/value-mirror.cc
[modify] https://crrev.com/defbef78d23186c04fb0f6c741f5907d5a894766/test/inspector/runtime/remote-object-expected.txt
[modify] https://crrev.com/defbef78d23186c04fb0f6c741f5907d5a894766/test/inspector/runtime/remote-object.js

Comment 8 by alph@chromium.org, Jan 17 (6 days ago)

Labels: Merge-Request-7.2
Status: Fixed (was: Assigned)

Comment 9 by alph@chromium.org, Jan 17 (6 days ago)

Cc: hablich@chromium.org

Comment 10 by alph@chromium.org, Today (12 hours ago)

Labels: -Type-Bug Type-Bug-Regression

Comment 11 by hablich@chromium.org, Today (12 hours ago)

Labels: -Merge-Request-7.2 merge-approved-7.2
Project Member

Comment 12 by bugdroid1@chromium.org, Today (10 hours ago)

Labels: merge-merged-7.2
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/2d9ed0dec76cd2266f7828a8abf401be3991e9c6

commit 2d9ed0dec76cd2266f7828a8abf401be3991e9c6
Author: Alexei Filippov <alph@chromium.org>
Date: Tue Jan 22 20:35:08 2019

Merged: [inspector] An Error with no stack description should not be empty

Revision: defbef78d23186c04fb0f6c741f5907d5a894766

BUG= chromium:919292 
LOG=N
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
R=dgozman@chromium.org

Change-Id: Idd2b1d02726f099446e2f83629c255c434113e62
Reviewed-on: https://chromium-review.googlesource.com/c/1427161
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/branch-heads/7.2@{#43}
Cr-Branched-From: 6acd03c9b8a8232aee95f25fbf6ae822aaedae75-refs/heads/7.2.502@{#1}
Cr-Branched-From: b03041de094610ef24e0e4fb6bf4c700fa1553ed-refs/heads/master@{#57910}
[modify] https://crrev.com/2d9ed0dec76cd2266f7828a8abf401be3991e9c6/src/inspector/value-mirror.cc
[modify] https://crrev.com/2d9ed0dec76cd2266f7828a8abf401be3991e9c6/test/inspector/runtime/remote-object-expected.txt
[modify] https://crrev.com/2d9ed0dec76cd2266f7828a8abf401be3991e9c6/test/inspector/runtime/remote-object.js

Comment 13 by alph@chromium.org, Today (10 hours ago)

Labels: -merge-approved-7.2

Sign in to add a comment