首页 > 应用开发 > IT综合 > SAP UI5应用的调试标志位的本地存储逻辑 - local storage使用的一个例子

SAP UI5应用的调试标志位的本地存储逻辑 - local storage使用的一个例子

原创 IT综合 作者:i042416 时间:2020-08-21 10:55:14 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.

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

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.

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

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

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

This API will change the following file in my laptop:

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:


来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量