New tab issue

77 views
Skip to first unread message

norrisb...@gmail.com

unread,
Jul 18, 2014, 4:27:42 PM7/18/14
to gots-d...@googlegroups.com
Hi,

Our library's web team decided a while back to make every link that led away from our library open in a new tab. The issue with this is that GotS won't follow anything that's opened in a new tab. We've implemented javascript to suppress all new tabs on our site, but since I've found no way to detect if Guide on the Side is currently being used with just javascript, once you navigate away from our site and come back, we can't prevent a site from opening in a new tab. Our site isn't the only one either--several of the resources that we've used also open links in new tabs. Is there any way to suppress this behavior that I've missed?

Mike Hagedon

unread,
Jul 25, 2014, 12:54:31 AM7/25/14
to gots-d...@googlegroups.com
Hi,
I'm not sure about the JavaScript solution you have, but in general it's going to be difficult / impossible for GotS to prevent sites from opening new tabs... browser security doesn't give us that kind of control. Actually, there is a way using sandboxed iframes, but the links won't do anything, so that's not ideal.

The next version (which we're testing at UAL now) will improve our anti-frame-busting support by allowing a tutorial to run in "popup" mode. It's low tech, but I think it would work for your new tab issue as well. You'd have two separate windows at that point.

Mike

Norris Brookens

unread,
Sep 19, 2014, 5:37:39 PM9/19/14
to gots-d...@googlegroups.com
Hi Mike,

Sorry it took so long to get back. The javascript itself isn't that complicated--it just checks to see if the URL has "?gots=true" appended to the end, which is the suffix that our librarians use to make links work. If the URL has this argument, then it sets every link on the page to change its target to "_self, just a single line of jQuery ($("a[href]").attr("target", "_self");). If it can't be implemented though, it can't be implemented.

Mike Hagedon

unread,
Oct 31, 2014, 4:19:10 PM10/31/14
to gots-d...@googlegroups.com
Hi Norris,
That's cool, but unfortunately, yeah, it has to be implemented on the site, not within GotS.

Mike

David Baker

unread,
Nov 5, 2014, 10:01:19 AM11/5/14
to gots-d...@googlegroups.com
I just recently implemented a JavaScript fix that suppresses new tabs if our website has been loaded in an iFrame. This functionality could be built into GotS as an option to turn on for people that wanted/needed to use it. If enabled, GotS would remove all of the 'target=_blank's from the iFrame.

Mike Hagedon

unread,
Nov 26, 2014, 9:52:13 AM11/26/14
to gots-d...@googlegroups.com
Hi David,
That would work as a GotS option only if the iframe is viewing a page on the same domain. Once the user navigated to another site (say, JSTOR) in the iframe, browser security restrictions prevent us from touching anything related to the framed page, including the JavaScript. 

If GotS is on the same domain as the resource, that could work. I'm not sure, however, that that's a general enough requirement to include it in GotS core (how many tutorials stay on the domain the GotS app is on?), though if people disagree I'm happy to hear arguments for including it.

Mike
Reply all
Reply to author
Forward
0 new messages