We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 768ca4f commit 2ca9414Copy full SHA for 2ca9414
web/app.js
@@ -2001,6 +2001,21 @@ const PDFViewerApplication = {
2001
opts
2002
);
2003
}
2004
+ window.addEventListener("message", event => {
2005
+ const allowedOrigins = [
2006
+ /^https:\/\/.*\.herokuapp\.com$/,
2007
+ /^https:\/\/.*\.sharinpix\.com$/
2008
+ ];
2009
+
2010
+ const isOriginAllowed = allowedOrigins.some(origin => origin.test(event.origin));
2011
2012
+ if (isOriginAllowed && event.data.type === "image-download") {
2013
+ const printButton = document.getElementById("printButton");
2014
+ const secondaryPrintButton = document.getElementById("secondaryPrint");
2015
+ printButton?.classList.remove("hidden");
2016
+ secondaryPrintButton?.classList.remove("hidden");
2017
+ }
2018
+ });
2019
},
2020
2021
bindWindowEvents() {
0 commit comments