Bug 453446

Summary: localStorage.getItem() don't works properly when the file html is offline
Product: [Applications] Falkon Reporter: Hervy Qurrotul Ainur Rozi <hervyqa>
Component: generalAssignee: David Rosca <nowrep>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.2.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: demo sidebar in falkon browser

Description Hervy Qurrotul Ainur Rozi 2022-05-06 01:18:46 UTC
Created attachment 148594 [details]
demo sidebar in falkon browser

SUMMARY
I have a website rendered with mdBook-0.4.18 (static site generator for documentation). mdbook using
localStorage.getItem to store the item object and display the toc (table of contents) sidebar.

        <!-- Hide / unhide sidebar before it is displayed -->
        <script type="text/javascript">
            var html = document.querySelector('html');
            var sidebar = 'hidden';
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            }
            html.classList.remove('sidebar-visible');
            html.classList.add("sidebar-" + sidebar);
        </script>

The sidebar appearance is saved when uploaded to https (panduan.langitketujuh.id), but is not successfully saved when the website is opened offline. I don't know if this is because it doesn't support it in Falkon browser or from the mdbook side. I just wanted to report it. Thank you ^^

STEPS TO REPRODUCE
1. $ git clone https://gitlab.com/langitketujuh/l7-docs #or other mdbook site.
2. $ cd l7-docs/
3. $ mdbook build
4. open docs/html/index.html with falkon browser.
5. enable sidebar.
6. go to next page.
7. sidebar again closes. should still be open.

OBSERVED RESULT
-

EXPECTED RESULT
localStorage.getItem() works properly when the file is offline.

SOFTWARE/OS VERSIONS
Operating System: Void Linux
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
-
Comment 1 Hervy Qurrotul Ainur Rozi 2022-05-07 07:54:32 UTC
Solved by falkon 22.04.0