Though not part of the library, this corrects/normalizes the license
headers in the demo app to be consistent with those in the library.
Issue #2638
Change-Id: I4546c4c6970d72ff71a37489fd582623bd6e2ca3
The IMA SDK URLs in the service worker were http, and should have been
https. This caused an issue when deploying v3.0.0 to appspot.
The IMA SDK URLs in the demo specified no protocol, but that is not
necessary, since https works in all contexts.
The IMA SDK URLs in the docs also specified no protocol, and one of
them was incorrect.
This corrects the mistaken URLs and makes them universally https.
Change-Id: I53dbf25ddb16ec882fcf3c070bcebed726277be1
We have decided to bump the major version number instead of the minor
number, based primarily on the fact that this release breaks
compatibility with our previous manifest structure.
Change-Id: I67e4c8267c6e103cfc7278e09daac186ae5cbbc6
In preparation for v2.6, update the service worker cache. Old caches
will be dropped, which should clean up any extraneous resources cached
by the v2.5 version.
Change-Id: Ief45857ba6033d65e4b267463f0a12a670b71535
Instead of waiting for all active pages to be closed and the old
service worker shut down, activate the new service worker right away
as soon as it is installed.
Change-Id: Ia49b6f44d026a934f46cb5cf2a86dc9de9274b0c
If the demo app is running in compiled mode, the PWA service worker
will now complain about any local resources that are requested by the
app but not marked for caching. This helps catch missing resources in
the service worker's resource lists.
Change-Id: Ia7f65f8ca6679e5c4ba29a1474a42aa97f33278b
Before this change, location.origin appeared in a list of cacheable
URL prefixes in the service worker. This was a lazy way of making
sure that all node modules, translations, etc. would be cached without
being explicitly listed. But it also meant that we could wind up
caching the uncompiled sources, which can complicate debugging if they
are inadvertently pulled from cache on reload.
This change adds the missing local resources that can't be listed
explicitly (translations, logos) by using absolute URL prefixes.
Change-Id: I4963516ec392e7607f86bc891bcdcf46c141951d
The URLs of critical and optional resources will now be converted to
absolute URLs. This will allow the exact URL matching against those
lists to work, which will let me subsequently remove location.origin
from the list of cacheable URL prefixes. (In a follow-up commit.)
Change-Id: I886d11435c96944f9b50ebf937dd329357f5c257
Some of the request URLs in service worker fetch events contain has
parameters, which breaks our exact URL lookups for critical and
optional resources. This fixes the lookups by removing hash
parameters.
Change-Id: I56b22a2faa42e2f3c28bd82fae4e8feedc83d408
Without the "await" on timeout, try/catch would not catch a timeout
error, leading to request failures in some cases.
This bug is present in v2.5.x as well as the master branch.
Change-Id: I3a0c8cd46265d41bade8117edd3cb92ac597d4fd
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.
This also updates the company name from "Google, Inc" to "Google LLC".
Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
When we upgraded the node modules, we missed the fact that this path
changed. This broke the demo app on Firefox, but not on Chrome, where
the polyfill is not needed.
Closes#1947
Change-Id: If889c46f840df7e3ee4aa67ab5026f0cebec2a41
This is a fully automated change. The linter will fail because the
extra indentation caused line-length errors. These won't be fixed
automatically. They are fixed in a follow-up to make this one fully
automated.
Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
The new mux.js release fixes support for a minified build, so we
should use that from now on.
videojs/mux.js#173
Change-Id: I08cff8d33a520fe753c5490a4719cba3bb27f19e
Importing in less is not enough. It will not necessarily inline what
is imported by default. The "inline" option, however, will force the
CSS file to be inlined. Without this, some of the `@import`
statements are put directly into the output file, triggering
additional network requests at runtime. This also adds the "css"
option, which forces less to treat these inputs as CSS and not as
LESS.
Finally, we import MDL for the demo app as a node dependency instead
of loading it from another origin.
This improves the demo's Lighthouse scores of "First Contentful Paint"
by 27% and "First Meaningful Paint" by 14%.
Change-Id: I28e627d3df494e3c4893d31b6bf818f09e8153e9
This reduces the number of resources we have to load by using LESS to
import them into the compiled CSS bundle.
This also gets rid of a flash of unstyled content in compiled mode by
always including the compiled CSS in HTML directly, regardless of
mode. If the app is running in uncompiled mode, LESS is still loaded
and can override the compiled styles.
Change-Id: I8cde25c15c281029a129225fc85a8baee767f424
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
- Use a minified mux.js and awesomplete.js
- Add rel=noopener to offsite target=_blank links for security
- Improve contrast on selected nav button and footer text
- Add empty alt attributes to asset images, since these are
not necessary to understand the page
Change-Id: I253c7354243aaa0fe98e1f075dae304ddad4a3e2
Some of the resources we load from other origins must be loaded as
opaque resources that can't be read by the application. In fact, it
turns out that there are no app resources that need to be read by the
app. So we should load everything in no-cors mode as opaque
resources. This fixes failures loading and caching MDL resources.
Change-Id: I25ec4228285e3149746d906e6461ac04aeedc7e1
- Don't cache Roboto Condensed, which is no longer used
- Add back style sheet to load the Roboto font, which is used
- Cache dialog and datalist polyfills used by the demo app
Change-Id: I0e347748a9830d95db0e4ba6bbfda7033edd3ac1
The service worker should not only be deciding what to cache, but what
to pull from cache. A recent refactor to this file overlooked this,
which caused resources from other origins not to be available offline,
even though they were cached.
Change-Id: I62d7c2f96827e778a991b06d0bd222c4f0cb336b
This is a complete replacement for the old demo page, made to be more
modern-looking and easier to maintain. It contains new features such as
remembering the URIs you provide for custom assets, and searching through
the default assets by feature.
This demo page is not quite ready for release yet, but it's getting close.
Change-Id: Iad01d1fc02c3cd238d73b9b9e02dbb4301cb6f2a
It seems that once you start handling a request in the service worker,
CORS restrictions are applied differently. So we shouldn't handle
requests that aren't application resources to be cached.
This cleans up the service worker and makes sure that we only handle
the requests we are supposed to. This avoid CORS errors reported in
a few old issues, as well as those seen in more recent Safari native
HLS work.
Issue #997Closes#1256Closes#1392
Change-Id: I0dff4a1f4f2a47b5f76a13625b673f717ebbd0ba
The demo app will now respond to events from the localization system
to lazy-load missing localization data at runtime. This will enable
the demo app to display a localized UI in non-compile-time-default
locales.
This required several changes to the compiled build to add missing
export annotations and quoted strings on event fields.
Issue #1688
Change-Id: I1e756d8ce7861bf822ec0e7d4090f143a201d422
The service worker was fetching an out-of-date URL for the controls
CSS. This updates the URL so that we are caching the correct files
for use offline.
Change-Id: I842a7f696e08e7d1b6505d24b7b9c763fb4f5a75
This replaces almost every instance of indexOf on both String and
Array. There are very few places where we really wanted an index.
Mostly, indexOf was used to check for inclusion.
Change-Id: I08e299768b6ffdb4bfc30b39b5d82a058c6d1b56
According to @beaufortfrancois, we should no longer be using protocol-
relative URIs. He quotes this passage from Paul Irish:
> Now that SSL is encouraged for everyone and doesn’t have performance
> concerns, this technique is now an anti-pattern. If the asset you
> need is available on SSL, then always use the https:// asset.
> Allowing the snippet to request over HTTP opens the door for attacks
> like the recent Github Man-on-the-side attack. It’s always safe to
> request HTTPS assets even if your site is on HTTP, however the
> reverse is not true.
Source: https://www.paulirish.com/2010/the-protocol-relative-url/
This change was begun with the following command:
git grep -l "'//" | xargs sed -i "s@'//@'https://@g"
Some changes made by that command were false-positives, which I then
reverted manually. Others required additional cleanup to meet style
rules.
I've also just discovered that the "max-len" rule in eslint's Google
style config exempts URIs, so there's no need to disable the max-len
rule on URIs in the assets list. These have been removed in the asset
list where unnecessary.
Finally, testing these updated URIs led to the discovery that two of
our third-party demo assets are no longer available. One URI needed
to be updated. The other had no obvious replacement, so it was
removed.
Closes#1390
Change-Id: I2fe23faec04f1904c1741236b364d5089900092a
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.
This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.
Change-Id: I93d0f3faedb8a42423b6971f6499d651b20492d1
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I270c70f6cda733ca6121d0761b4c1c162104d379
This digests and organizes many of the automatic settings in eslint,
and changes several of them to be more strict. This also fixes the
following errors:
- array-callback-return
- no-catch-shadow
- no-multi-spaces
- no-new
- no-throw-literal
- no-useless-call
- no-useless-concat
- no-useless-return
Several checks have been organized into a group of checks we should
use, but need more time to implement and fix. Some other checks have
been delegated to the Closure compiler, which can more precisely
whitelist exceptions.
Issue #1157
Change-Id: I8fe4966959e08050f8159e6a1fee161e7d71177e
This adds a service worker, which will cache application resources to
make the application itself available offline in browsers which
support service workers.
Issue #876
Change-Id: I13096b2d4b9236d2a3f220af6b1dfce43d7a0004