简体   繁体   中英

Disable Offline navigation from browser history

browser: Firefox (latest) Scenario:

  1. User loggedin into the site, opens some page that requires valid login credential. Then Loggedout from the site.
  2. Set the "Work Offline" mode from file menu of the Firefox.

  3. Now from browsing history (ctrl+H) user can view the pages/content of the pages. Although clicking on any link will not work still user can view the offline content.

I have used meta tag and .htaccess to disable the caching of page. and used back button disable functionality eg:

<script language="javascript" >
history.go(-(history.length - 1)); /* undo user navigation (ex: IE Back Button) */
</script>

Preferred Solution: Either browser will not store the history.

Or User swill not be able to view pages (my website page only) in "Work Offline" mode.

I am afraid this is something you cannot avoid. If the page has been loaded once, the browser needs no more backend requests to serve the content again and again. In the front, any javascript solutions could be bypassed disabling javascript in the browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM