So I have th开发者_如何学Cis IFRAME in my web page, the iframe has a login page (this is part of my domain) but then after the login the iframe redirects the user to an external site (not in my domain) but still is inside the iframe but without the option to right-click (disabled in the HTML code of that external page).
I can enable the right click if I login in that site without an iframe with a simple JavaScript code, but if I access this site through the iframe I'm using, I can't enable the right click there.
This is the code I'm using trying to enable right click:
javascript:function r(d){d.oncontextmenu=null;d.onselectstart=null;d.ondragstart=null;d.onkeydown=null;d.onmousedown=null; d.body.oncontextmenu=null;d.body.onselectstart=null;d.body.ondragstart=null;d.body.onkeydown=null; d.body.onmousedown=null;};function unify(w){r(w.document);if(w.frames.length>0){for(var i=0;i
So is there any way to enable the right click inside an iframe? even if it is an external domain?
Thanks
tl;dr: How to enable right click in IFRAME with javascript or any other tool.
You cannot inject Javascript into the external page on a separate domain in the way you describe. Sorry.
精彩评论