New issue
Advanced search Search tips

Issue 737044 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 719052
Owner:
Closed: Jun 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 719052



Sign in to add a comment

Deprecate importScripts for non-installed scripts

Project Member Reported by falken@chromium.org, Jun 27 2017

Issue description

Service workers can currently do
importScripts('script-that-was-never-installed.js');

We need to ban this. UMA suggests that 0.25% of importScripts() on Windows does this, and 0.80% on Android.

Tasks:
- Pipe whether the script was installed to ResourceResponse.
- In ServiceWorkerGlobalScope, if the script was not installed, print a deprecation warning.

I don't know how to track down which sites are doing this.... UKM or RAPPOR?
 

Comment 1 by falken@chromium.org, Jun 27 2017

Hm.. could probably use RAPPOR for this. Looks similar to the ServiceWorker.ControlledPageUrl RAPPOR code.

Comment 2 by falken@chromium.org, Jun 27 2017

Status: Started (was: Assigned)
What's "installed" in this case?

Comment 4 by falken@chromium.org, Jun 28 2017

nekr.fabula: See https://github.com/w3c/ServiceWorker/issues/1021#issuecomment-266708110 (just updated the issue description too). The service worker shouldn't do importScripts() for a script that wasn't already imported at the time of installation.
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0d227e663c9fb97a44ca0db3264693d51cda6050

commit 0d227e663c9fb97a44ca0db3264693d51cda6050
Author: Matt Falkenhagen <falken@chromium.org>
Date: Wed Jun 28 03:16:05 2017

service worker: Add RAPPOR for non-installed importScripts()

I want to deprecate this spec violation out there is apparently a fair
amount of usage in wild. Add RAPPOR to discover where the usage is
coming from.

Bug:  737044 
Change-Id: If0090b6793387a2a1f4c9d9236b7bcc6ecb7186a
Reviewed-on: https://chromium-review.googlesource.com/549742
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482869}
[modify] https://crrev.com/0d227e663c9fb97a44ca0db3264693d51cda6050/content/browser/service_worker/service_worker_context_request_handler.cc
[modify] https://crrev.com/0d227e663c9fb97a44ca0db3264693d51cda6050/content/browser/service_worker/service_worker_metrics.cc
[modify] https://crrev.com/0d227e663c9fb97a44ca0db3264693d51cda6050/content/browser/service_worker/service_worker_metrics.h
[modify] https://crrev.com/0d227e663c9fb97a44ca0db3264693d51cda6050/tools/metrics/rappor/rappor.xml

Comment 6 by falken@chromium.org, Jun 29 2017

Blocking: 719052

Comment 7 by falken@chromium.org, Jun 29 2017

Mergedinto: 719052
Status: Duplicate (was: Started)

Sign in to add a comment