File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 67
67
return ! isNWApp ( ) && ! isChromeWebApp ( ) ;
68
68
}
69
69
70
+ function isCrossOriginSubframe ( ) {
71
+ if ( ! window . parent ) return false ;
72
+ try {
73
+ return window . parent . location . host != window . location . host ;
74
+ // if actually cross origin, this will throw "Blocked a frame with origin ... from accessing a cross-origin frame."
75
+ } catch ( e ) {
76
+ return true ;
77
+ }
78
+ }
79
+
70
80
/// Does the currently connected board have an ARM processor that can execute Thumb code?
71
81
function isARMThumb ( ) {
72
82
var data = Espruino . Core . Env . getData ( ) ;
@@ -971,6 +981,7 @@ while (d!==undefined) {console.log(btoa(d));d=f.read(${CHUNKSIZE});}
971
981
isChromeWebApp : isChromeWebApp ,
972
982
isProgressiveWebApp : isProgressiveWebApp ,
973
983
hasNativeTitleBar : hasNativeTitleBar ,
984
+ isCrossOriginSubframe : isCrossOriginSubframe ,
974
985
isARMThumb : isARMThumb ,
975
986
escapeHTML : escapeHTML ,
976
987
fixBrokenCode : fixBrokenCode ,
You can’t perform that action at this time.
0 commit comments