Intent to Deprecate: IDBFactory webkitGetDatabaseNames

瀏覽次數:210 次
跳到第一則未讀訊息

Joshua Bell

未讀,
2017年2月28日 晚上8:26:432017/2/28
收件者:blink-dev
Primary eng (and PM) emails

jsb...@chromium.org

Summary

Remove the non-standard webkitGetDatabaseNames() method on IDBFactory. 

Note that the spec has never had a non-prefixed version. This has always been Chrome-only.

Motivation

We added this feature when Indexed DB was relatively new in Chrome and prefixing was all the rage. The API asynchronously returns a list of existing database names in an origin, which seemed sensible enough.

The design is flawed, in that the results may be obsolete as soon as they are returned, so it can really only be used for logging, not serious application logic. The github issue https://github.com/w3c/IndexedDB/issues/31 tracks/links to previous discussion on alternatives, which would require a different approach. While there's been on-and-off interest by developers, given the lack of cross-browser progress here the problem has been worked around by library authors.

Compatibility And Interoperability Risk

Edge: Not supported

Firefox: Not supported

Safari: Not supported

Web developers: Requested, but only used in a handful of libraries due to lack of cross-browser adoption. Comes up on StackOverflow every so often.

Alternative implementation suggestion for web developers

Ostensibly, an origin should know a priori what code it has previously shipped and therefore what databases may have been created. In practice, many sites use libraries (like Dexie.js) which abstract away database creation in various ways. Due to the lack of cross-browser support here, libraries do things like storing such metadata in another database.

In general, origins can just ignore databases they don't care about. The case where this is problematic is if a database holds a sizable amount of data and is then "forgotten" by the developers, consuming the origin's quota. Without the ability to enumerate, the only recourse here for the origin would be via the Clear Site Data mechanism.


Usage was at 0.001% until a few weeks ago when it spiked up to 0.01% with a bimodal distribution which is a bit odd. Reading the tea leaves, I'd guess a big site (possibly an analytics provider?) started using it.

HTTPArchive shows 42 hits, all of which are one of these three libraries (mostly the first two):

Regular tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=696010

Entry on the feature dashboard

Will file if approved.

Requesting approval to remove too?

No; proposing that we land deprecation in 58 (if this gets LGTMs in time) and remove in 60.

We'd also file bugs against the three libraries indicating that a deprecation warning and eventual removal is planned.

Trivia:

This was the first new feature I implemented as a Chrome Noogler.

Chris Harrelson

未讀,
2017年2月28日 晚上8:55:112017/2/28
收件者:Joshua Bell、blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Dimitri Glazkov

未讀,
2017年3月1日 上午10:50:092017/3/1
收件者:Chris Harrelson、Joshua Bell、blink-dev
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

TAMURA, Kent

未讀,
2017年3月1日 下午6:18:022017/3/1
收件者:Dimitri Glazkov、Chris Harrelson、Joshua Bell、blink-dev
LGTM3.


LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.



--
TAMURA Kent
Software Engineer, Google


nvi...@gmail.com

未讀,
2017年5月30日 下午5:03:182017/5/30
收件者:blink-dev
How to delete all indexedDBs related to a domain, but without knowing the names of databases? Chrome extensions use this function thousands times a day and you want to remove it. Why you follow the specification if it only bears harm? So what is real reason to remove that function? Please do not tell the community about the spec, because this sounds very stupid. Any alternative to get names and delete all databases for a domain?

Reilly Grant

未讀,
2017年5月31日 上午10:54:462017/5/31
收件者:nvi...@gmail.com、blink-dev
Please keep this conversation respectful. There is no need to call people or ideas stupid or assume there is an unstated ulterior motive.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

blake.a....@gmail.com

未讀,
2017年8月4日 下午2:31:442017/8/4
收件者:blink-dev
indexedDB is a potential vector for tracking. For example if a 3rd party iframe is loaded on a site, that 3rd party can write some unique value to indexedDB. The next time that 3rd party origin is loaded it can check the indexedDB for the value, and use it to uniquely identify the client. 

This situation necessitates a way for clients to inspect indexedDB on some origin for its database names so that privacy compromising information can be deleted.

jac...@gmail.com

未讀,
2018年11月13日 下午2:24:192018/11/13
收件者:blink-dev、blake.a....@gmail.com
Would you consider adding a method that allowed deleting of all databases (available to the origin) without enumerating them (and hence obtaining any useful information about them)? This would be extremely helpful for some test runner code that I'm working with, and I don't think it introduces any new privacy concerns. It also aids with the previously described case of "forgotten databases" (or, perhaps more realistically, "accidentally created databases) since it would all developers to write migration/upgrade code for their sites to "start fresh".

BTW, as a pathological example regarding privacy, what is to stop someone from tracking users by storing a very large amount of data so as to use the estimated storage usage as a sort of loosely unique identifier? e.g. storage usage is available via `navigator.storage.estimate().then(est => console.log(`${(est.usage*Math.pow(2,20)).toPrecision(3)}MiB used`))`, so one could set 20MiB for one user, 30 for another, etc. Since storage used legitimately may be sufficiently negligible it would be possible to differentiate clients based on what range their storage usage falls into.

PhistucK

未讀,
2018年11月13日 下午3:55:512018/11/13
收件者:jac...@gmail.com、blink-dev、blake.a....@gmail.com
A standard way to enumerate databases is in the works, so while you will lose webkitDatabaseNames, the functionality will be otherwise supported.
See the intent thread for details.

PhistucK


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e1eb824f-631b-44d5-bd02-178d5650af8d%40chromium.org.
回覆所有人
回覆作者
轉寄
0 則新訊息