Skip to content

Commit

Permalink
PWA: Disable service worker on shared domains #425
Browse files Browse the repository at this point in the history
  • Loading branch information
lastzero committed Jul 13, 2021
1 parent 4fcd009 commit 81629f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions frontend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import VueInfiniteScroll from "vue-infinite-scroll";
import Hls from "hls.js";
import { $gettext, Mount } from "common/vm";
import * as options from "options/options";
import offline from "@lcdp/offline-plugin/runtime";
import * as offline from "@lcdp/offline-plugin/runtime";

// Initialize helpers
const viewer = new Viewer();
Expand Down Expand Up @@ -185,4 +185,6 @@ if (navigator.appVersion.indexOf("Chrome/") !== -1) {
// Start application.
Mount(Vue, PhotoPrism, router);

offline.install();
if (config.baseUri === "") {
offline.install();
}
9 changes: 8 additions & 1 deletion frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ const config = {
}),
new webpack.ProgressPlugin(),
new VueLoaderPlugin(),
new OfflinePlugin(),
new OfflinePlugin({
relativePaths: false,
publicPath: "/",
excludes: ["**/*.txt", "**/share.*"],
rewrites: function (asset) {
return "/static/build/" + asset;
},
}),
],
performance: {
hints: isDev ? false : "error",
Expand Down

0 comments on commit 81629f0

Please sign in to comment.