Skip to content

Commit

Permalink
Gh-pages for live demo viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaprsd committed Jul 30, 2024
1 parent 5132ffa commit 497945a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/pdfjs
Submodule pdfjs updated 2 files
+1 −1 web/viewer.html
+1 −2 web/viewer.mjs
8 changes: 2 additions & 6 deletions src/scripts/extension.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/* Load extension scripts and add-on into the viewer page */
if (window.location.protocol === "moz-extension:") {
import("./mv2/page-script.js");
} else {
import("./mv3/page-script.js");
}
import "./mv3/page-script.js";
import "./doqment.js";
import "/doq/addon/doq.js";
import "../doq/addon/doq.js";
19 changes: 8 additions & 11 deletions src/scripts/mv3/page-script.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { getPdfUrl } from "../utils.js";
import { execOnEvent } from "../utils.js";

/* Copy PDF URL to clipboard */
chrome.runtime.onMessage.addListener(respond);

function respond(request) {
if (request.action === "copyPdfURL") {
const pdfUrl = getPdfUrl();
if (pdfUrl.startsWith("http"))
navigator.clipboard.writeText(pdfUrl);
}
}
/* Make Solarized the pre-selected color scheme */
execOnEvent("init", [() => {
let pref = JSON.stringify({ scheme: 3, tone: "1" });
localStorage.setItem("doq.preferences.light", pref);
pref = JSON.stringify({ scheme: 3, tone: "2" });
localStorage.setItem("doq.preferences.dark", pref);
}]);

0 comments on commit 497945a

Please sign in to comment.