Control the tab in which an externally called URL is opened - javascript

I've got a program (not a web application, but an executable) that spews URLs, the URLs are handled by Internet Explorer by default.
The problem: Each URL is opened in a new tab whereas it should be the same tab.
If it's relevant: I'm trying to match an interface of an old (web)application to a new one. The URL is redirected on the server. In the old situation, the URL would open a webpage, start an Active-X control and then close the browser. I'm not in such position now, I cannot use that technique because the new application is a full fledged zero footprint webapp.
Remember that I can't control the browser. It's not opened by me so I cannot do fancy stuff in Javascript for instance.
How to handle this? The best thing I can come up with is changing settings in Internet Explorer, so that it'll always throw away what is in the current tab and replace it with the new URL. Is this possible at all?
I'm not even interested in the tabs as such, if I can always open URLs in an running browser in for instance the first tab I'll be a happy camper.

Thank heaven for co-workers.
In Internet Explorer do Alt+T, O to start the internet options dialog.
In the dialog click the button 'Tabs' and the dialog 'Tabbed browser settings' appears.
Here in 'Open links from External programs in:' select the option 'The current tab or window'.
It does have a drawback that whatever browser or tab is active loses it's content when an external program fires a URL, but that's less offensive than opening browser tab after browser tab...

Related

Chrome/Safari: how to open the same window from different tabs or windows

In a web application, I have an optional popup window into which logging content is being loaded. This window is opened via Javascript using window.open().
The users typically have multiple tabs of the application open and my intention is to always reuse the same popup window (if currently open), no matter from which tab they trigger the popup. To do so, I use code similar to this to open the popup:
<script>
function myFunction() {
var myWindow = window.open("popup.html", "my_popup", "width=600,height=400,status,resizable");
}
</script>
This works fine in Firefox and IE - only a single popup window is ever opened and all content that I want to log is being loaded into that window.
Chrome and Safari however, use different popup windows depending on the tab from which the popup is launched.
I assumed that the second parameter of window.open() specifies a target name from a global namespace, which seems to be the case for most browsers. But Chrome and Safari behave as if there were tab-specific namespaces for these target names, i.e. "my_popup" referenced from tab 1 refers to a different target than "my_popup" from tab 2. (to make things more complicated, tabs that have been "duplicated" seem to share the same namespace, i.e. they do reuse the same popup window, but tabs created otherwise don't.)
Is there a way to circumvent this behavior of Chrome and Safari and access the same popup window from all tabs that the user may have open?
Or do I have to assume that this is browser-specific behavior for which there seems to be no workaround?
I have tested this with various browsers:
IE 11.0.9600.18204
All tabs with content from the same domain open/reload a single shared popup window (i.e the target namespace seems to be local per domain).
All tabs with content from file:// URLs reuse the same popup window as tabs with content from http:// URLs that point to the local intranet.
Firefox 46.0.1
All tabs with content from the same domain open/reload a single shared popup window (i.e the target namespace seems to be local per domain).
All tabs with content from file:// URLs use their own single shared popup window (i.e. file:// URLs seem to have their own target namespace).
Edge 20.10240.16384.0
The behavior is inconsistent: in most of my tests, Edge behaved like Firefox, but occasionally like Chrome as well.
I don't have a problem in ignoring Edge for the time being.
Chrome 50.0.2661.94
Each tab opens or reloads its own popup window (i.e the target namespace seems to be local per tab)
Safari 9.1
Each tab opens or reloads its own popup window (i.e the target namespace seems to be local per tab)
By the way, in all of these browsers the behavior does not depend on whether or not the popup window was launched due to user interaction: the behavior is identical between cases where the popup is launched via body onload() and cases where it is loaded via button onclick().
[here's additional background information that I assume not to be relevant to the problem, but who knows... ;-)
Actually, our application does not directly open the popup windows, instead we're using log4javascript which opens a logging window (or in case of Chrome: multiple logging windows). I'm willing to extend the log4javascript code to deal with this and send a patch to the maintainer, but in order to do so I need to solve the basic problem described above]

How to disable minimize in ie

I have thin client station, we are using Web Browser Control(the taskbar and start menu are disabled) Web Browser Control is the only option that user can access to the internet.Every thing is fine till here.But there are Particular Links in some pages where new IE window will open(Page will open in new ie window). If the IE Window is minimized the user's cannot see it. If there are 20 of IE7 minimized then the system hangs.
i cant use Kiosk Mode (iexplore -k). because user should allowed to close.
I cant change web pages.
But i Can inject Javascript(no Jquery) in to the Pages.
How Can i Hide/Disable Minimize, if i cant is there is any work around for this.

Why do Android browsers (Chrome/stock) force twitter intents to close then open in the same window, even when _blank or window.open are used?

Example of what I mean:
http://jsfiddle.net/dtipson/ttebddd5/2/
In all other browsers, and in cases not linking to twitter's intents pages, when you open a new window or target blank, it opens in a new tab. But with android, even once you've set the browser to handle links to twitter.com, the new window opens, then immediately closes, and then the original (calling) page navigates to twitter.com. Example code that won't work properly (though I doubt it's anything to do with this):
window.open(
'https://twitter.com/intent/tweet?text=hi',
'intent',
'scrollbars=yes,resizable=yes,toolbar=no,location=yes,status=no,width=550,height=420');
My guess is that this has something to do with have Android handles "application intents": if a page redirects to something that claims to have a native application link, it looks back up the chain of window.opener and affects the original page instead.
To try and block this behavior, I've tried using window.open to open a page that waits a few seconds and THEN redirects to twitter.com/intents. But even here, the new tab opens, waits for however many seconds on that transition page, and then right when it redirects, it closes itself and the original tab redirects to twitter.com instead. I've tried setting window.opener to null (even though that shouldn't do anything). I'm not sure how any code on twitter.com could even affect the original page as they are obviously not on the same domain (and I've tried setting things up so that the original domain does NOT have twitter's widgets.js on it, so they can't be using POSTMessage).
This really seems to be a (imho, bad) )quirk with how Android handles intents. Anyone know of any workarounds?

How to get Chrome to open multiple sites in a new tab

I'm developing a tool that lets you open multiple pages at once with a shortcut, to be used for things like opening your daily sites or querying multiple search engines for a phrase. In Firefox, Internet Explorer and Opera, assuming you've unblocked pop-ups for the domain, the code works as expected.
Chrome, however, opens the sites in new windows instead of tabs if the links are opened automatically when the page loads. If openAll() is commented out and the button is clicked or a key is pressed, the pages open in tabs. Note it's calling the exact same function.
The best solution I've found (which isn't saying much) is the One Window extension. It works, but you can see the new window open then get sucked back in, and it keeps you from opening new Windows with Ctrl-N, forcing you to drag tabs out to use another Chrome window.
I can understand there not being a programmatic way to change this because it's a browser setting, but as a user of the tool it's annoying to have the sites all open in new windows. Is there a Chrome setting or extension that will open links in tabs when they're loaded without user input? I realize opening a bevy of windows is the very thing browsers aim to stop, but this is one time where I want to allow it.
<input id="openAllBtn" type="button" value="Open all links"> (Or press any key)
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
function openAll() {
window.open('http://yahoo.com/');
window.location.replace('http://www.bing.com/');
return false;
}
$(document).ready(function() {
$(document).bind('keypress', openAll);
$("#openAllBtn").bind("click", openAll);
openAll();
});
</script>
Here's a Fiddle of the code: http://jsfiddle.net/sfzjR/
Is there a Chrome setting or extension
that will open links in tabs when
they're loaded without user input?
Check out the create method in the chrome extension docs. By default it will open a new tab, you can optionally specify the window you want that tab to open in, and give the tab a url.

Open links in new tab in Firefox

I am developing an Firefox extension. How can all the links on a webpage to be opened in a new tab?
That's usually a configurable option in Firefox to handle new links, so they may override your extension with that.
However...
The code
Example Website
will allow you to click the appearing words [Example Website], and the link will open in the current window.
The code
Example Website
Opens the link in a new window/tab.
The only mildly dodgy thing is that target is now apparently deprecated by the W3C, which means that it's generally up to the browser ( and the user's preferences) as to how (or even if) it is handled. But for people who have their preferences set accordingly - in Firefox - that should work.
I found what I was after. I wanted gbrowser.addtab(this.href).
Press Ctrl while clicking on the link on Windows. Use cmd on OSX.

Categories

Resources