|
@@ -219,20 +219,25 @@
|
|
|
|
|
|
|
|
|
|
//Check if the website allow iframe
|
|
//Check if the website allow iframe
|
|
- checkIfAllowIframing(targetURL, function(allowIframe){
|
|
|
|
|
|
+ checkIfAllowIframing(targetURL, function(allowIframe, redirectTarget){
|
|
if (allowIframe == null){
|
|
if (allowIframe == null){
|
|
$("#xframe").attr("src", "notfound.html#" + targetURL);
|
|
$("#xframe").attr("src", "notfound.html#" + targetURL);
|
|
}else{
|
|
}else{
|
|
if (allowIframe == true){
|
|
if (allowIframe == true){
|
|
|
|
+ $("#xframe").removeAttr("srcdoc");
|
|
$("#xframe").attr("src", targetURL);
|
|
$("#xframe").attr("src", targetURL);
|
|
}else{
|
|
}else{
|
|
proxyWebContent(targetURL, function(content){
|
|
proxyWebContent(targetURL, function(content){
|
|
$("#xframe").attr("src", "");
|
|
$("#xframe").attr("src", "");
|
|
- $("#xframe").attr("srcdoc", content)
|
|
|
|
|
|
+ $("#xframe").attr("srcdoc", content);
|
|
|
|
|
|
});
|
|
});
|
|
//alert("Target website do not allow embedding");
|
|
//alert("Target website do not allow embedding");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (redirectTarget != undefined && redirectTarget != ""){
|
|
|
|
+ $("#urlText").val(redirectTarget);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
});
|
|
@@ -252,18 +257,21 @@
|
|
ao_module_agirun("Browser/functions/getHeader.js", {
|
|
ao_module_agirun("Browser/functions/getHeader.js", {
|
|
url: url
|
|
url: url
|
|
}, function(data){
|
|
}, function(data){
|
|
- if (data == "null"){
|
|
|
|
|
|
+ let xFrameOptions = JSON.parse(data);
|
|
|
|
+ let header = xFrameOptions.header.toLowerCase().trim();
|
|
|
|
+ let location = xFrameOptions.location;
|
|
|
|
+ if (header == "null"){
|
|
//Site not exists
|
|
//Site not exists
|
|
callback(null);
|
|
callback(null);
|
|
}
|
|
}
|
|
- let xFrameOptions = JSON.parse(data).toLowerCase().trim();
|
|
|
|
|
|
|
|
- if (xFrameOptions == "sameorigin" || xFrameOptions == "deny"){
|
|
|
|
|
|
+
|
|
|
|
+ if (xFrameOptions.header == "sameorigin" || xFrameOptions.header == "deny"){
|
|
//This webpage do not allow iframeing
|
|
//This webpage do not allow iframeing
|
|
- callback(false);
|
|
|
|
|
|
+ callback(false, location);
|
|
}else{
|
|
}else{
|
|
//This webpage allow iframing. Show it
|
|
//This webpage allow iframing. Show it
|
|
- callback(true);
|
|
|
|
|
|
+ callback(true, location);
|
|
}
|
|
}
|
|
}, undefined, 5000)
|
|
}, undefined, 5000)
|
|
}
|
|
}
|