Protect Iframe From Openining In New Window Or Tab - iframe

I am adding framed content to a wordpress blog in a membership area. Is there a way that I can prevent that content from being opened in a new window or tab? A plugin or a string of code I can add?
As it is now if someone right clicks on the frames content they can view it in a new window and possibly share that URL rendering the membership site useless in controlling who views....
I would like a block.... If possible...I see other iframes popup an error message when you try and view....
Any help is appreciated!
Thank you for a great place for info

One possible solution I can think of is now to add JavaScript code to prevent right click, but again this is not always going to work because the person can simply disable JavaScript and they can still right click to see the content of the iframe. Not only that there is alway a way to sniff the URL of the iframe by either using some sort of software or even using something like FireBug.

Related

I need help in a iframe

I do not have much knowledgement of HTML, CSS, etc. and I work on a Wordpress website.
My question is how do I make an iframe like in this website http://www.stadtrundfahrten-muenchen.de/de/startseite/#top when I click in the order button!?
I have a similar website with boxes and a button saying "order now", in fact the iframe should be equal to that website because its the same ticketing provider. They sent me the iframe link but cannot make like that website!
can anyone help me with this or tips?
regards
The website you mentioned does not use iframe anywhere. If you are trying to set dynamic size of an iframe please reefer here: how-to-set-iframe-size-dynamically
It would be good if you can post the iframe you are trying to implement
ok here it is the code:
You vcan visit the website http://hmk.no are the boxes in frontpage, the one which says book now.
And i would like a iframe or window transparent like here in this site:
http://www.stadtrundfahrten-muenchen.de/de/startseite/#top
[https://office.instantticketing.com/pit/webshop/widgetconfig?key=khaxfcarjhtso4h9lubk5ywwcp21386707097031'>]

How can I prevent this plugin from popping up from behind the content area?

I have this strange issue going on with my CSS on my site, and I'm hoping someone can help me out. I have a sharer box to the left of each of my posts. When you click the box to share (for instance the twitter box) the pop up box goes behind the post content, instead of in front of it. Anyone have any ideas on how to fix this? To see it for yourself, visit one of the posts and try to click on the google plus, or facebook like button (don't worry, it won't actually share unless you confirm it) You can view one of the posts to see what's going on here ---> http://noahsdad.com/child-down-syndrome-friend/ J
Thanks.
Here are a few screen shots of what is going on d.pr/ZCPy and http://d.pr/ax6H
Try with z-index:99999; on pop up box.
For the video shown in the post, add wmode="opaque" to the <object> / <embed> tag.

Drupal6: Theming Node Edit pages / Opening within Lightbox

I'm trying to display all node_edit form neatly within a lightbox without any of the excess content I don't want. No sidebars, footer, header, nothing. Just the content. So I created a page-node-edit.tpl.php file.
I have two problems daunting me, but for now I'll only mention the first since its more important.
1) From any drupal page, clicking on the "edit" link for the node doesn't activate the lightbox like it should. Instead it clicks-thru the link as normal.
With jQuery in the header I added a rel attribute for the lightbox to the links, but the box still doesn't activate. I tested the lightbox on a link I hardcoded into the page, and it activated just fine. For elements generated by Drupal, like the node edit link/button the problem seems to be timing.
I think the rel attribute needs to be built with the page, with the link, rather than appended onto it. The catch is, the link lacks an id and class, so I don't see how the hook_alter_link() function can help me.
I'm willing to try anything. Perhaps someone has done this before? Opened a node/edit form within a lightbox.
Any suggestions would be greatly appreciated.
I've seen the Modal Frame API used in a few modules (Node Relationships uses it to do something very similar to what you're doing); might be helpful...
http://drupal.org/project/modalframe

Back button loop with IFRAMES

In my (school) website we use Iframes to display class blogs (on blogger). This works well EXCEPT if the user then clicks on (say) a photo inside the iframe. Blogger (in this case) then displays the photo in the whole browser window and the back button loops; that is if the back button is hit, the browser (IE, FF, Chrome) stays on the same page. The only way out is for the user to jump back two pages (which many of our users don't know how to do).
I've read a lot of posts on back buttons and iframes and there doesn't appear to be a simple solution. Bear in mind that I don't have control over the iframe content (so no embedded back buttons in the frame are possible). Ideas anyone?
The solution I would use would be to loop through the iframe content after it has been loaded and set target attributes on links in the iframe so that they open in either the iframe, or in a new window. Here's an example using jQuery:
$('#iframeID').contents().find('a').attr('target', '_blank');
You could do something similar using a loop and DOM methods, I'll post some code to do that if your not sure how to go about it.
EDIT: can't access the content if its cross domain, so this wouldn't work in this case

How to prevent a iframed page from opening in a new window

I have a site iframed in and it has a bunch of links in the menu. The way their site is built they have all the links in the menu set to open the pages in a new window. Is there any way to override this and have it open in the iframe?
Thanks,
Matt
If you can get around the security issues, I'd suggest looking at jQuery in order to take over the click event for all the links. If your hosted on different domains and don't have control over the local browser your probably out of luck.

Resources