DevTools has a feature to simulate device modes in the browser page. The emulation is implemented using a separate frame, called the “device mode emulation frame”.
When a user turns on device mode emulation, a top bar with pre-defined device modes and page width/height is shown. The UI is implemented in front_end/panels/emulation/. However, the code that controls the UI runs in the context of the devtools_app.
As such, the JavaScript that runs in the devtools_app frame controls the UI in a separate frame. This has several implications:
devtools_app via window.openerdevtools_app (such as settings), it needs to access the information in the correct frame. For example, any information coming from localStorage has to be mediated via API‘s in devtools_app. Typically, these API’s live in front_end/panels/emulation/AdvancedApp.ts