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