Clicking Safari 5.1 Select Menu Refreshes Page

Clicking Safari 5.1 select menu refreshes page

Final Answer:

I found a final fix for the problem we were specifically having on our site. After the site loads, we have the TypeKit library attaching fonts to the page. When I specifically set the font-family property on the select boxes to something other than the TypeKit font, the refresh behavior no longer presents itself.

I'm not sure if you're using TypeKit or not, but that would be a good place to look first.


Original Answer:

I encountered this issue as well today on one of the sites that my company runs. I had narrowed it down to a set of CSS rules that were most likely causing it (commenting those out would not produce the bug on page reload).

The main issue I see with this could very well be a security issue in the browser itself. If you have any open sessions in any tabs, it will clear their session data as well.

Find a page that has this bug, and open several other tabs where you log into a Google account, or some other set of accounts. When you click the select boxes on the site with the bug, the page is refreshed, and the sessions in the other tabs are reset as well.

Update:
I have narrowed down the set of CSS rules that are affecting our page. Any one of these CSS rules will cause this behavior:

  • -webkit-appearance
  • border
  • border-style
  • border-radius
  • -webkit-border-radius
  • background-repeat
  • background-position
  • background-image

I had originally thought that it was the -background-image property that was causing issues, as we're using a data image, instead of an actual png or jpg (to give a style similar to the default in Firefox), but I was apparently wrong.

Update 2: I tried using CSS resets to put things back to normal using a webkit-specific CSS hack, but just touching any of these CSS rules seems to cause things to go haywire. I guess we will need to just remove the rules until there is a fix for this.

Update 3: It seems to have something to do with the Javascript being loaded on the page. If I disable Javascript in Safari, this does not happen.

Why do tabs automatically refresh in Safari 5.1?

I am not sure why this happens. But I found this in a forum:

This issue occurs when the IOS is running low on RAM memory, and cannot store the entire page in the cache.
On Mac OS X, that is a feature to Safari 5.1. Web pages auto-refresh if they are left inactive for a period of time. It can be indirectly disabled in debug menu.
Close Safari, launch Terminal, input “defaults write com.apple.Safari IncludeInternalDebugMenu 1”. This will enable Safari debug menu.
Then open Safari, and you will notice a new menu “Debug” appeared beside the “Help”. Deselect the option “Use Multi-process Windows” in the “Debug” menu.
Reopen the Safari, you will notice Safari is in single process mode and marked as “SP”. This will prevent the automatic refreshing of webpages.
But there is the downside for this method. Many plugins and extensions will not work. So it is up to you. Or you can use Chrome or Firefox.

Why does this javascript based printing cause Safari to refresh the page?

I'm not sure if this will fix your problem but i recently found a very good Jquery plugin to print only certain part of your webpage.

You should give it a try :) It has a some very cool parameters to customize it to your needs.

Take a look here.

Why does your page refresh? Here's my answer on that. the window.print() function will print the entire content of your page. So since i read that you only want to print a part of the page, I guess you are using some function to remove all unwanted content from the page for a very short moment, then you call the window.print() function and after that you put all orignal content again on the screen. This results in a very short flash that will look like your page is refreshing and will load all flash parts again.

I had the same problem yesterday and this jquery plugin really helped me out. I hope it will help you too.

Have a nice day!

Safari stays loading when window.onbeforeunload returns false

I was able to reproduce this issue even while skipping OP's steps 2 and 3. Any form of reload exhibits this issue. Minimalistic steps to reproduce:

  1. Visit the page in question.
  2. Hit reload.
  3. Click "Stay on Page" button.

The loading progress is visually pre-engaged right after the reload hit and stays so for the entire life of the confirm dialog (apparently in an effort to communicate the "hanging over cliff edge"-type mature of the situation ;) However:

  • When dialog is dismissed with "Stay on page" button, it leaves the stopping X symbol on and the loading progress still engaged and frozen somewhere around 10% mark.
  • This "loading" can NOT be cancelled by any means (keyboard, button, script).
  • Network tab in Web Inspector asserts NO loading happening.

This really looks like a Webkit/Safari UI bug - it looks to fail to disengage the progress bar in stay-on-page conditions. Best would be to report it to the Webkit team or, since you experience this in Safari, maybe the Safari team would be better.

Safari 5.1.7 mixing headers from content to page?

/test.php will always set header("Cache-Control: no-store, no-cache, must-revalidate"); There is nothing interesting about the headers saying do not cache because you're explicitly setting those headers.

/test.php?img=whatever will NEVER set the Cache-Control headers as above and will always return blank 304 Not Modified. You're exiting right after the header() call. Technically it is not an image to apache. It's mime type will be text/html so it will carry your expires/caching as html and php (in your .conf and/or htaccess). Unless you do header('Content-Type: image/jpeg', true); or similar.

It's also good to use the second parameter of header() in order to replace previous ones in some circumstances.

Try this instead. let me know if you get the same result

<?php
if (isset($_GET['img'])) {
header('Content-Type: image/jpeg', true);
header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified', true, 304);
exit;
} else {
header('Expires: -1', true);
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0', true);
}
?>


Related Topics



Leave a reply



Submit