On mobile Chrome, if you click "back", you will have the last page states remained, is it possible to do it on desktop? - google-chrome

I found that if you are on a mobile chrome page, when you click a link to open another page (in the same tab), and then if you click "back" button, you will have the previous state remained.
For instance, on an interactive page (let's say it's examplea.com), you did a lot of actions and the DOM is totally changed, then you occasionally opened a new page in the same tab by clicking a link or somehow. The new page is exampleb.com.
On desktop, when you click the "back" button, it will redirects you back to examplea.com and everything is gone.
On mobile, when you click the "back" button, it will redirects you back to examplea.com with everything unchanged.
Is there any trick that I could make this also happen on desktop?

Related

Clicking link with target _blank makes browser close new tab immediatly

Clicking on a link to our webpage using
Link
opens a new tab and closes it immediatly. This happens on all browsers apparently. Deactivating adblock and alike does not change anything.
Using the url without target="_blank" or right click -> open in new Tab however works fine.
The web page is an angular project and does not use any sort of trackers. Furthermore this behavior started only recently, so I assume it's due to some change in the page.
Any hint why this happens or where to start debugging this?
Found it.
I had a line window.close(); due to a workaround for a popup for facebook login, implementing this:
Facebook Login not working in PWA app if app is in stand alone state

Page load from browser back button click

Is there a way to detect if the page load occurred from clicking the browser back button?
I have to take a different action on page load if it was due to user landing on the page by hitting the browser back button.

jquery mobile's popup widget doesn't play well with Chrome

Unfortunately, I can't reproduce the issue in jsfiddle, but this test file reproduces the issue: github file
Basically, I have a standard popup and a close button inside that popup. I can open the popup. I can close the popup. I can do this over and over again without a problem.
However, when I bind the "popupafterclose" event to the popup, which reopens the popup after receiving that event. Now something weird happens.
On my iPhone 5S's Chrome (v38.0.2125.67), after the second close, the page goes back beyond the popup and to the previous page, as if it was hitting "back" twice.
This only happens on my phone's chrome. The test page works fine on my phone's safari. it also works fine on my mac's chrome (v38.0.2125.104).
I suspect this may be some sort of bug prevention mechanism (like preventing too many popups or infinite loops), but wanted to confirm. I'm hoping I'm just doing something wrong in my code.
If you comment out the "popupafterclose" event, you'll see that you can open/close the popup again and again in every browser including mobile chrome. But automatically re-opening the popup and closing it leads to backing out twice.
You may be wondering why I would want to immediately open the popup after I just closed it. My app has a "play" function that initiates the popup. Upon closing it, I want it to continue to "play" after the popup closes, and some time later, the popup may initiate the popup again. After closing that second instance of the popup, my app backs out of itself.

Avoid back button from refreshing a page on IE/Chrome browser

I have developed a webpage which has an option to "Add link". On clicking the button, the user gets a pop up window to add a link. Once he submits the entry the base page refreshes to show up as a hyperlink and not "Add link" anymore. When the user clicks on the link, he gets redirected to the webpage belonging to the link. On clicking the back button on IE/chrome from the webpage corresponding to the link he comes back to the initial page but with an option of "Add link" again. Which is incorrect, he should just see the link and not an option to add link. However on refreshing the page it goes back to show the link. Noticing this issue only on IE and google chrome and works well with Mozilla Firefox. Kindly help.

Chrome scrolls up the page when I click on a link on a large image map

In Google Chrome browser, when I click on a link on a large image map, the page scrolls up as if the PhUp key were pressed.
When I test the page with Firefox and IE8, everything is fine.
Does anyone know anything about this problem with Chrome browser?
example page: http://www.futerox.in/winksquare
Please open the page in Chrome, scroll down and click on any image (not ad) on the image grid. You'll see that the whole page scrolls up.
This looks to me like you aren't preventing the default click event handler. Couldn't determine where you hook up your image map. Try adding an evt.preventDefault() or a return false in your event handler for the image map.