mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 10:23:28 +01:00
stop security error, if iframe source is not from our own origin
This commit is contained in:
parent
6c2610ca50
commit
12fcd5709b
@ -251,11 +251,14 @@ window.fw_browser = (function(){ "use strict"; return Class.extend(
|
|||||||
self.iframe.setAttribute('allow', 'fullscreen');
|
self.iframe.setAttribute('allow', 'fullscreen');
|
||||||
self.iframe.setAttribute('allowfullscreen', true); // for older browsers
|
self.iframe.setAttribute('allowfullscreen', true); // for older browsers
|
||||||
|
|
||||||
// bind load handler to set overflow-y: auto on body of contentDocument to allow vertical scrolling
|
// for own origin: bind load handler to set overflow-y: auto on body of contentDocument to allow vertical scrolling
|
||||||
|
if (_url[0] === '/' || top.location.origin === _url.replace(/^(https?:\/\/[^/]+)\/.*$/, '$1'))
|
||||||
|
{
|
||||||
self.iframe.addEventListener('load', (ev) => {
|
self.iframe.addEventListener('load', (ev) => {
|
||||||
const body = self.iframe.contentDocument.getElementsByTagName('body')[0];
|
const body = self.iframe.contentDocument.getElementsByTagName('body')[0];
|
||||||
body.style.overflowY = 'auto';
|
body.style.overflowY = 'auto';
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//Load the iframe content
|
//Load the iframe content
|
||||||
self.iframe.src = _url;
|
self.iframe.src = _url;
|
||||||
|
Loading…
Reference in New Issue
Block a user