This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 4f802be415 tweaks to load events in the iframe - try to avoid
transient 'about:blank'
4f802be415 is described below
commit 4f802be415fa2282aa2ee67ad24a28b2b71b5993
Author: greg-dove <[email protected]>
AuthorDate: Tue Mar 3 18:13:44 2026 +1300
tweaks to load events in the iframe - try to avoid transient 'about:blank'
---
.../apache/royale/html/elements/SecurityIframe.as | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git
a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/SecurityIframe.as
b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/SecurityIframe.as
index 36601113e9..10edca6a24 100644
---
a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/SecurityIframe.as
+++
b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/SecurityIframe.as
@@ -35,14 +35,8 @@ package org.apache.royale.html.elements {
public class SecurityIframe extends Iframe {
public function SecurityIframe() {
super();
- COMPILE::JS
- {
- (element as
HTMLIFrameElement).addEventListener('load', onStatus);
- (element as
HTMLIFrameElement).addEventListener('error', onStatus)
- }
}
-
private var _checkExpectedOrigin:Boolean = true;
/**
* This is true by default. Setting it to false will also allow
message handling from
@@ -67,7 +61,6 @@ package org.apache.royale.html.elements {
{
if (w === root)
return true;
-
w = w.parent as Window;
}
@@ -87,13 +80,16 @@ package org.apache.royale.html.elements {
return _allowNestedFrames;
}
-
+ private var _srcSet:Boolean;
override public function set src(value:String):void
{
- super.src = value;
-
COMPILE::JS
{
+ if (!_srcSet)
+ {
+ (element as
HTMLIFrameElement).addEventListener('load', onStatus);
+ (element as
HTMLIFrameElement).addEventListener('error', onStatus)
+ }
try{
expectedOrigin = new URL(value,
window.location.href).origin;
} catch(e:Error) {
@@ -104,6 +100,9 @@ package org.apache.royale.html.elements {
activateMessaging(true);
}
}
+ _srcSet = true;
+ super.src = value;
+
}
@@ -132,6 +131,7 @@ package org.apache.royale.html.elements {
}
}
}
+
COMPILE::JS
private function onStatus(e:Object):void{
var localEventType:String =
'iframe'+e.type.charAt(0).toUpperCase() + e.type.substr(1)
@@ -186,7 +186,6 @@ package org.apache.royale.html.elements {
//accept messages also from nested iframes
if (!isDescendantWindow(e.source as Window,
contentWindow as Window))
return;
-
}
//extra optional check to make sure the data received
conforms to some expectations