Jump to content

How exactly does browser (Chrome) refill backed pages field info/selection

Have a table page that displays information. Several simple HTML drop down boxes to control the behavior of it. 

 

If I ever go open a sub page and ever back to this same page (specifically browsers back button), the page quickly selects again the drop down boxes I had previously selected and the page on.

 

Problem is that this quick reselection is not quick enough and is out of sync with rest of JS code, main issue is that it's behind Document.Ready. 

 

How exactly does Chrome remember these boxes, where is this information stored and what way would I have to get some control over this feature? For example call a function when Chrome wants to refill or reselect the drop down box that was selected before I left the page. Not sure if this is imporant, the page is based around jQuery Datatables. Haven't found anything to say that the datatable system is responsible for this behaviour but might be imporant.

 

I've tried looking at recorded Chrome cache between page changes, loading and reopening the pages with a back button but didn't really know where to look, a ton of information is stored.

Desktop: Ryzen 7 5800X3D - Kraken X62 Rev 2 - STRIX X470-I - 3600MHz 32GB Kingston Fury - 250GB 970 Evo boot - 2x 500GB 860 Evo - 1TB P3 - 4TB HDD - RX6800 - RMx 750 W 80+ Gold - Manta - Silent Wings Pro 4's enjoyer

SetupZowie XL2740 27.0" 240hz - Roccat Burt Pro Corsair K70 LUX browns - PC38X - Mackie CR5X's

Current build on PCPartPicker

 

Link to comment
Share on other sites

Link to post
Share on other sites

It's most likely in a SQLite database along with other information about the website and info about what content is cached.

You don't control how browser fills that form. Each browser may fill it differently, or may not even push events to Javascript when the form is auto filled - there's other browsers besides Chrome.

 

You could add code to store the information on your form to user's local storage with some unique ID associated with that form so that when the form is reloaded, code on your page can read the unique ID from the page and then access the local storage and fill back the content.  This is sort of how this forum refills this post comment box if you accidentally close the tab or hit the back button.. it periodically saves the text to local storage of the browser....  see picture below (click to zoom)

 

image.thumb.png.cd60862926bdce04a34314bf7804c261.png

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, venomtail said:

Delete this before posting

nice
 

If it can't be stored in the cookie (4KB max) it's likely stored in the IndexedDB subsystem

5950X/3080Ti primary rig  |  1920X/1070Ti Unraid for dockers  |  200TB TrueNAS w/ 1:1 backup

Link to comment
Share on other sites

Link to post
Share on other sites

I don't think browser is the one doing this. Some web apps and sites persists their user data for user convenience. It might be in local storage or it might be from a backend database.

 

For example, if you want to change user account settings and informations, e.g. password, username ect, a web app administrator panels would've prefill the form with all your current settings/information and allow you to modify what you need from there. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×