首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP UI5应用的调试标志位的本地存储逻辑 - local storage使用的一个例子

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

作者头像
Jerry Wang
发布2020-08-20 16:36:56
3370
发布2020-08-20 16:36:56
举报

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:

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-08-19 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档