File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2001,6 +2001,21 @@ const PDFViewerApplication = {
2001
2001
opts
2002
2002
) ;
2003
2003
}
2004
+ window . addEventListener ( "message" , event => {
2005
+ const origins = [
2006
+ / ^ h t t p s : \/ \/ .* \. h e r o k u a p p \. c o m $ / ,
2007
+ / ^ h t t p s : \/ \/ .* \. s h a r i n p i x \. c o m $ /
2008
+ ] ;
2009
+
2010
+ const originAllowed = origins . some ( origin => origin . test ( event . origin ) ) ;
2011
+
2012
+ if ( originAllowed && 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
+ } ) ;
2004
2019
} ,
2005
2020
2006
2021
bindWindowEvents ( ) {
You can’t perform that action at this time.
0 commit comments