简体   繁体   中英

How to set window.opener in Firefox

I have old code, which uses window.opener. I changed opening method of these pages from popup to iframe in a jquery dialog. That works fine with IE and Chrome, where I only need to reset window.opener in onload event. But Firefox does not play ball. It sets opener to null regardless what the opener was or is to be set (which is ludicrous). Is there a way to change window.opener in Firefox? I known I could work around it by storing the opener information elsewhere, but it takes a lot of more changes.

It's not ludicrous to prevent you overriding read-only properties of host objects. In short, no there is no way to change it. What you need to do is string replace all references to window.opener with a different value and place the object you're interested in there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM