Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
390 views
in Technique[技术] by (71.8m points)

javascript - Is it possible to disable right click on an iframe?

Is it possible to disable right click on an iframe? I know it might be possible if the file in the iframe resides in the same domain,but i was wondering if it could be done if the file in the frame was from an external site?

thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can't really disable the context menu to begin with. You can only construct fragile barricades to keep people from invoking it. But the fact that this is an external iframe only compounds the issue. No, you can't keep the users from activating the context menu on your iframe. Sorry.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...