resource-timing icon indicating copy to clipboard operation
resource-timing copied to clipboard

Collect initiatorType use-cases

Open nicjansma opened this issue 7 years ago • 3 comments

There are a few concerns and questions with initiatorType. Some examples:

  • CSS files are included via <link> tags so have a initiatorType="link", which causes confusion since there is a separate css initiatorType that is used if a CSS file downloaded something (e.g. fonts, background-image)
  • <link rel="preload"/> preloaded resources all have initiatorType="link" too
  • <video> tag behavior is inconsistent and may need to add clarity: https://github.com/w3c/resource-timing/issues/130
  • <video poster=""> and <video src=""> would both be initiatorType="video"
  • etc

We are considering how to best address these concerns/questions. Is it better to fix and clarify V2 for cases that we can? Or should we design something differently for V3 that works better?

In order to make that decision, we should try to capture as many use-cases as possible -- what elements/things/etc trigger downloads and what info would consumers want about those downloads?

Example Use-Cases

These are the use-cases I know about:

  • <img src="...">
  • <img srcset="...">
  • <link rel="stylesheet" href="...">
  • <link rel="prefetch" href="...">
  • <link rel="preload" href="...">
  • <link rel="prerender" href="...">
  • <link rel="manfiest" href="...">
  • <script src="...">
  • CSS @font-face { src: url(...) }
  • CSS background: url(...)
  • CSS background: url(data:...) (shouldn't be downloaded)
  • CSS @import url(...)
  • CSS cursor: url(...)
  • CSS list-style-image: url(...)
  • <body background=''>
  • <input src=''>
  • XMLHttpRequest.open(...)
  • <iframe src="...">
  • <frame src="...">
  • <object>
  • <svg><image xlink:href="...">
  • navigator.sendBeacon(...)
  • fetch(...)
  • <video src="...">
  • <video poster="...">
  • <video src="..."> with Range: requests
  • <video><source src="..."></video>
  • <audio src="...">
  • <audio src="..."> with Range: requests
  • <audio><source src="..."></audio>
  • <picture><source srcset="..."></picture>
  • <picture><img src="..."></picture>
  • <picture><img srcsec="..."></picture>
  • <track src="...">
  • <embed src="...">
  • <a ping="..."> (too late?)
  • favicon.ico and other auto-downloads
  • UA extensions
  • EventSource

I'm probably missing some things in the above list.

nicjansma avatar Dec 15 '17 21:12 nicjansma

There are also downloads initiated from extensions that sometimes show up in ResourceTiming data. I think @jzyang has seen a bunch of strange url schemes show up in our resource timing data as well. I'll let her chime in with more info.

bluesmoon avatar Dec 18 '17 16:12 bluesmoon

We'll keep this issue for Level 3 to decide how we can address some of the above confusion.

We'd also like to build tests for all existing Level 2 behavior. That is tracked in https://github.com/w3c/resource-timing/issues/138

nicjansma avatar Jan 19 '18 15:01 nicjansma