Skip to content

Commit

Permalink
Merge pull request GoogleChromeLabs#110 from gierschv/fix-companion-ie
Browse files Browse the repository at this point in the history
Companion: Avoid old IE errors with document.currentScript
  • Loading branch information
wibblymat committed Apr 8, 2016
2 parents 78ad6bc + 359ee7d commit 8da9b87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
(function() {
'use strict';
var workerScript = document.currentScript.dataset.serviceWorker;
var workerScript = document.currentScript && document.currentScript.dataset.serviceWorker;

if (workerScript && 'serviceWorker' in navigator) {
navigator.serviceWorker.register(workerScript);
Expand Down

0 comments on commit 8da9b87

Please sign in to comment.