Skip to content

Commit

Permalink
I keep having the same error so I added this
Browse files Browse the repository at this point in the history
if (event.request.cache === 'only-if-cached' && event.request.mode !== 'same-origin')
return
And all errors are gone :-) meanbee/magento-meanbee-pwa#20 (comment)
  • Loading branch information
englishextra committed Sep 29, 2020
1 parent b0e8761 commit 118c5b7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ self.addEventListener("fetch", function (event) {
};

event.waitUntil(updateCache(event.request));

/*!
* https://github.com/meanbee/magento-meanbee-pwa/issues/20#issuecomment-497626347
*/

if (event.request.cache === "only-if-cached" && event.request.mode !== "same-origin") {
return;
}

event.respondWith(
fetch(event.request).catch (function (error) {
console.log("[sw.js] Network request Failed. Serving content from cache: " + error);
Expand Down
2 changes: 1 addition & 1 deletion libs/serguei-muicss/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ WheelIndicator, Ya*/
};
if (instagramMedia) {
if (!root.instgrm) {
var jsUrl = "https://www.instagram.com/embed.js";
var jsUrl = "https://platform.instagram.com/en_US/embeds.js";
var load;
load = new loadJsCss([jsUrl], initScript);
} else {
Expand Down
2 changes: 1 addition & 1 deletion libs/serguei-muicss/js/bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libs/serguei-muicss/src/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ WheelIndicator, Ya*/
};
if (instagramMedia) {
if (!root.instgrm) {
var jsUrl = "https://www.instagram.com/embed.js";
var jsUrl = "https://platform.instagram.com/en_US/embeds.js";
var load;
load = new loadJsCss([jsUrl], initScript);
} else {
Expand Down
9 changes: 9 additions & 0 deletions sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ self.addEventListener("fetch", function(event) {
};

event.waitUntil(updateCache(event.request));

/*!
* https://github.com/meanbee/magento-meanbee-pwa/issues/20#issuecomment-497626347
*/

if (event.request.cache === "only-if-cached" && event.request.mode !== "same-origin") {
return;
}

event.respondWith(
fetch(event.request).catch(function(error) {
console.log(
Expand Down
3 changes: 1 addition & 2 deletions sw.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 118c5b7

Please sign in to comment.