Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

UI5 debug flag and Local Storage - how is your setting persisted?

$
0
0


We know that once we enable debug mode via "Ctrl+Alt+Shift+P", this setting will be persisted: even if you turn off your laptop and launch the application tomorrow, the debug mode will still be there.

clipboard1.png

In Chrome development tool, there is an Application tab which records this setting via key value pair using Local Storage.

clipboard2.png

As usual we can still use debug to investigate what has happened when the checkbox "Use Debug Sources(reload)" is clicked.

 

In Chrome development tool Elements tab, click the small arrow icon to enter the element inspection mode, then click the checkbox, then its html source code will be automatically navigate.

clipboard3.png


Perform global search via keyword "useDbgSources", and then we can find the event handler onUseDbgSources for debug mode set:

clipboard4.png

Set a breakpoint on this function, then mark the checkbox in UI, breakpoint is triggered as expected:

clipboard5.png

Within the function, we can know the debugging flag is set via localStoage API: window.localStorage.setItem

clipboard6.png

This API will change the following file in my laptop:

clipboard7.png

clipboard8.png

If I open the changed file via some SQLite management tool, I can find the corresponding entry with key sap-ui-debug and value 'X' set:

clipboard9.png


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>