Whenever a normal alert box displays on a Chrome tab, it disappears when you switch the tab (ok is triggered automatically). Not the same behaviour on Firefox. I am wondering why? Didn't find any answers... Thanks.
Duplicate? Javascript : Alert Box dismissed when tabs switched
From Google: "This is working as intended, see Issue 629964 . It's not a security bug; a user could make the dialog box disappear with developer tools or myriad other tricks as well."
I recently upgraded Sitefinity from 9 to 10. After the upgrade I am not able to edit the content of content blocks on the pages. This only happens with Chrome. Everything seems to work just fine in IE and FireFox. After clicking "Edit" on any of the Content type controls (Content block, image, video, ect) the white loading box shows and then just goes to an all white window the the x to close it out. Any of our custom widgets work fine. There are no Javascript errors showing in the console. Has anyone seen this type of behavior and how is it fixable?
** Note ** The MVC Content types do seem to work. It appears that it's just the regular Content types that do not seem to work correctly.
Have you zoomed in or out your Chrome browser?
I've seen this issue with Chrome and WebForms widget designers.
Just try to zoom in and out the browser while the widget designer is open - you should start seeing the contents of the designer.
How not to allow Alert Box to be dismissed when tabs switched.
Using alert("Test"); on Google Chrome, when you switch tabs, the alert dialog box disappears, and when you're back on the same tab you have full access.
What I want is to do the same thing as stackoverflow website when you create a question and try to close the tab, there's a dialog box that pops up that doesn't allow you to go anywhere until you choose between (Leave or Stay).
IE and Firefox work differently, I mean block the tab when using alert("Test"); statement but Google Chrome doesn't block.
I sent a bug report to Google but they replied to me that :
This is working as intended, see Issue 629964.
It's not a security bug; a user could make the dialog box disappear with developer tools or myriad other tricks as well.
I was able to get around this issue by calling my javascript alert in an iframe
I would like to point out that this appears to have reached a compromise; current (Version 110.0.5481.104 (Official Build) (64-bit)) shows alert() and confirm() on the tab, but do not prevent going to another tab.
When user returns to the original tab - the message box is still there waiting for them.
So this allows persistence, without "hijacking the browser". :)
I am showing alert on this. But alert is clipped on the either sides, width of popup is 320px. How can I display the entire alert ?Pop-up screen
That problem occurs when Chrome is running on Windows 7. It occurs when alert is smaller than 370px. I have the same problem and I found that it is a bug in Chrome when is used on Windows 7.
In your screenshot the popup is cropped to the parent window size.
Resize the window to show the full alert box.
In all browsers I know the alert-box is always a child of the browser window, so it can never reach outside the browser window.
Option 1
You could use JS to resize the browser window (e.g. make window wider before alert, smaller again after alert):
window.resizeTo( width, height );
Option 2
Create your own JS popup box instead of using alert(). You cannot style the alert() box, but you can control size/design of a custom popup you create
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.