When i open a new window using window.open javascript, chrome opens with about:blank, but firefox opens with jsfiddle back url and if you right click on the page, you can still see the page loading. You will not see the refresh icon, instead a stop icon is appearing.
I need to open the new window with about:blank.
Here is the jsFIDDLE
Tested with Chrome 45.0
Tested with Firefox 41.1
<button id="helper">Click here for help</button>
What you are experiencing is a new Firefox behavior that passed in version 40 or 41 (sorry I did not find the reference).
Expect it to become part of google's behavior soon too, you can see people requesting it already(Chrome issue)
Unfortunately there is not much that can be done for now as it is brand new people have not found workaround or even if it is a good idea to fight against the browser... My suggestion is to not use about:blank at all and use a blank html page from your domain, that would make things easier on the users.
Instead of about:blank take #:
$("#helper").click(function(){
windowURL = window.open("#","Looking ....
EDIT
in order to prevent the browser from showing an "infinite loading", close the document:
...
openedDocument.open();
openedDocument.write(myHTML)
openedDocument.close()
Related
I'm using the following code to open a new tab on click of a PDF download.
The problem is the new tab becomes the main tab often before the PDF loads.
How can I make the view stay on the current window (PDF) and open the new tab but not switch to it?
Note: In Chrome and Opera they understand the HTML5 download tag so the PDF simply downloads and the current window redirects - All good! So this is only a problem on IE & Firefox.
<h2 style="text-align: center;"><a href="http://cdn2.hubspot.net/hub/155045/file-847580737-pdf/Stepping_into_a_new_age_of_marketing_with_CRM_FINAL_APPROVED.pdf" onclick="casestudiesopen()" download><strong>Click here to download your eBook</strong></a></h2>
<script>
function casestudiesopen() {
window.open("http://www.workbooks.com/case-studies");
}
</script>
Well, I'll advise you to read this Stackoverflow answer, which is, in a way, quite similar to yours (the purpose anyway) :
Javascript disable switches current tab functionality in browser
JS/JQuery is indeed very powerful but also have its limits. Imagine a web page always requesting and keeping focus once you've opened it. I think you would be really annoyed, among other things.
That's why browsers prevent those kind of actions. Common browsers at least. Meaning, there's no way to prevent a browser like Firefox, Chrome, IE & Co. to focus a table since it depend of user's parameters.
You'll have to find a way to workaround your problem. I can propose this answer since it seems to have worked for the other guy.
I have latest google chrome version -32.0.1700.107 m installed on windows 8 machine.
I am doing this:
popup = window.open();
popup.print();
This opens a new popup and a print window appears. Now, when I go back to the page from where I triggered this, it freezes and I cannot do anything there.
Here is the small fiddle for your reference. FIDDLE
Click the button and come back to the fiddle page (do not close the print page) and try typing anything in the fiddle, it will be hanged and as soon as you will close the print page, the fiddle window will get normal.
This is in Google chrome ONLY, other browsers are working smoothly. Please help.
I tried:
Opening the popup in new window using window.open("","","width=800,height=600").
Putting popup.close().
opening it on some different OS (windows 7, XP)
But got no success
Please some kind soul help me with this issue or some work around.
This is an issue in Google Chrome and will be fixed in Chrome 36 according to this issue.
I am using Google Chrome Frame (GCF) with IE9 and when I open a javascript dialog it opens in a tab instead of a dialog.
My IE setting for 'Tabbed Browser Settings' -> 'When a pop-up is encountered:' -> 'Let Internet Explorer decide how pop-ups should open'
I use this javascript to open a window:
window.open("http://google.com/", "_blank",
"location=0,status=no,toolbar=no,menubar=no,width=800,height=600,scrollbars=no,resizable=no");
If I change the IE setting to 'Always open pop-ups in a new window' it works. The problem lies in that I need to change that setting on every IE9 computer in the company and the computer administrators are hesitant to do this.
According to Microsoft documentation if you specify a width/height it will open in a dialog but this is not the case when using GCF.
Is there anything I can do (other than changing the setting) that will force the dialog to open in a new window instead of a tab?
Also IE is crafty it tells you it changes the setting but sometimes it actually doesn't so when testing close out of the browser all the way after changing the setting (I got all excited once after it 'worked' but it was actually the setting not updating in IE).
You have to use the rel="noreferrer" in a standard link (no window.open).
I went through reams of documentation trying to figure this out.
Fortunately ChromeFrame isn't needed as much since IE11 seems to support most things (although IE11 has a horrible memory leak).
[a href="http://www.google.com" rel="noreferrer" target="_blank"]Rel No Referrer Is the Key[/a]
I am opening pop up windows from a website (flash content) the following way:
RING = window.open(path,'RING_Projekt','width=800,height=600,scrollbars=no,top=' + t + ',left=' + l +'');
The HTML file opened in the popup is valid HTML with a <title>, yet Chrome (all other browsers do work fine) will display "Untitled" in the title bar.
Does anyone know why this is happening and if there is an error / workaround that could fix this? Or is this some kind of a pop up blocker malfunction / bug?
Thanks!
EDIT: Playing around, I noticed the following (unfortunately it ADDS to my confusion...): the page with the flash content opens another popup (displaying news) on load by doing:
var NEWS = window.open('popup/news.htm','RING_news','width=400,height=400,scrollbars=no,top=20, left=20');
When I now open a popup with the function mentioned in the above post, then go and close the news-Popup opened on load and then switch back to the "on-click"-Popup the popup magically acquired a name. When you close this and open it again, the name is gone again.
To be honest: I don't get it. I should be able to have more than one pop-up, right? Also, I cannot see any naming problems or anything else that could explain this behavior.
Am I missing something big here? Or is this a plain bug?
Ok, I am a 99.99% sure this is a Chrome bug, so I'll answer this myself.
Chrome seems to read the specified title correctly from the HTML (as it will be displayed in the task bar), but seems to have problems when having to display the name in the bar on the popup (see screenshot below). When you start to fiddle with the popup (move / resize), the title will sometimes appear and disappear again. Yet, the names in the task bar will always be right (that plus the fact that it works in every other browser lets me think it is a bug).
I am running Chrome 14.0.835.186 m on Windows Vista.
http://code.google.com/p/chromium/issues/detail?id=113201
its a open bug
This is a bug with Chrome. However, there is a workaround for this.
If you put the following script in the page that opens in the popup window, it seems to work fine.
<script language"text/javascript">this.window.resizeBy(1,1);this.window.resizeBy(-1,-1);</script>
The second argument to window.open isn't the <title> of the new window, used by <a target="...">, for example.. The title is determined by the content of the page.
See MDN docs for more info.
The following javascript opens a pop-up in Firefox, Safari, IE, and Google Chrome:
window.open("http://google.com", "foo", "toolbar=yes,location=yes,menubar=yes")
However, in Google Chrome the toolbar (with the usual forward and back buttons, etc.) does not appear on the popped-up window. (Tested on both Windows and Mac.)
How can I fix this? I would like the user to be able to navigate forward and back using the tools with which they are most familiar.
There is a bug open for Chrome:
https://code.google.com/p/chromium/issues/detail?id=82522
It has not received a lot of attention from Google. Vote for it.
Unfortunately Chrome only supports a small set of window features when using window.open. If you believe that this is a bug or an issue you can file it at [http://crbug.com].
If you just use window.open(url) then it will open a new tab in the same window with the buttons you desire.
Updating on current behavior (as of 4/26/2017)
The expected behavior should be a new PopUp Window when size dimensions are passed as arguments to window.open (if toolbar is enabled, then add the toolbar to the PopUp window). If no dimensions are indicated just default to opening a new tab (in this case toolbar enabled is the default).
(Btw, this is FF current Behavior (version 54.0a2)) .
Chrome Behavior (Canary 60.0.3079.0)
Opens PopUp Window to indicated dimensions
window.open("https://google.com","foo","width=800, height=780")
Opens New Tab (browsers default minimized size, ignores size dimensions)
window.open("https://google.com","foo","width=800, height=780,toolbar=1")
FF Behavior
w/Size Dimensions
Opens PopUp Window w/o ToolBar (NO toolbar)
window.open("https://google.com","foo","width=800, height=780")
Opens PopUp with ToolBar
window.open("https://google.com","foo","width=800, height=780, toolbar=1")
w/o dimensions
Opens New Tab
window.open("https://google.com","foo")
window.open("https://google.com","foo", "toolbar=1")
The only option for Chrome is to not specify a third argument. Chrome ignores the third argument as they are rightly allowed to do according to the HTML 5 specification, but if present the window appears to always open in a floating widow without controls.
If you do not specify a third argument the window that opens will be a new tab and will have all of the features the user needs.
If you do specify a third argument you will get a new floating window with no controls other than the URL display.
I know this is an old post, but the most recent answer is from September, 2013, so I am taking that as a reason to follow up with this answer. Advance apologies if this is not proper etiquette.
https://code.google.com/p/chromium/issues/detail?id=82522
That's the link to the bug over on the Chrome support page.
I am posting it here in the hope that others experiencing this problem will raise attention to this issue, as suggested in a previous answer.
My apologies for posting this comment as a separate answer. I don't have enough karma to do this the right way.