File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2001,6 +2001,22 @@ const PDFViewerApplication = {
2001
2001
opts
2002
2002
) ;
2003
2003
}
2004
+ window . addEventListener ( "message" , event => {
2005
+ const origins = [
2006
+ / ^ h t t p : \/ \/ l o c a l h o s t : 5 0 0 0 \/ c a n v a s _ t e s t .* / ,
2007
+ / ^ h t t p s : \/ \/ .* \. h e r o k u a p p \. c o m $ / ,
2008
+ / ^ h t t p s : \/ \/ .* \. s h a r i n p i x \. c o m $ / ,
2009
+ ] ;
2010
+
2011
+ const originAllowed = origins . some ( origin => origin . test ( event . origin ) ) ;
2012
+
2013
+ if ( originAllowed && event . data . type === "image-download" ) {
2014
+ const printButton = document . getElementById ( "printButton" ) ;
2015
+ const secondaryPrintButton = document . getElementById ( "secondaryPrint" ) ;
2016
+ printButton ?. classList . remove ( "hidden" ) ;
2017
+ secondaryPrintButton ?. classList . remove ( "hidden" ) ;
2018
+ }
2019
+ } ) ;
2004
2020
} ,
2005
2021
2006
2022
bindWindowEvents ( ) {
You can’t perform that action at this time.
0 commit comments