tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 9fff00790aa17d1a3750b5ababbdb979e9457e09
parent ac37996dbcf154e00fc6a389c5669802a2a2f5ce
Author: Lorenz A <me@lorenzackermann.xyz>
Date:   Mon,  8 Dec 2025 08:08:33 +0000

Bug 2004207 - [devtools] Turn dom-view.js into an ES class. r=devtools-reviewers,nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D275245

Diffstat:
Mdevtools/client/dom/content/dom-view.js | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/devtools/client/dom/content/dom-view.js b/devtools/client/dom/content/dom-view.js @@ -28,14 +28,17 @@ const store = createStore(reducers); * for rendering the content. It renders the top level ReactJS * component: the MainFrame. */ -function DomView(localStore) { - addEventListener("devtools/chrome/message", this.onMessage.bind(this), true); - - // Make it local so, tests can access it. - this.store = localStore; -} +class DomView { + constructor(localStore) { + addEventListener( + "devtools/chrome/message", + this.onMessage.bind(this), + true + ); -DomView.prototype = { + // Make it local so, tests can access it. + this.store = localStore; + } initialize(rootGrip) { const content = document.querySelector("#content"); const mainFrame = MainFrame({ @@ -52,7 +55,7 @@ DomView.prototype = { ); this.mainFrame = ReactDOM.render(provider, content); - }, + } onMessage(event) { const data = event.data; @@ -61,8 +64,8 @@ DomView.prototype = { if (typeof this[method] == "function") { this[method](data.args); } - }, -}; + } +} // Construct DOM panel view object and expose it to tests. // Tests can access it through: |panel.panelWin.view|