mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibWebView: Clear the Inspector DOM/accessibility trees upon reset
This prevents rendering stale trees while navigating to a new page. The old non-WebView inspector widgets behaved this way.
This commit is contained in:
parent
60c7ff9db1
commit
41ffc69c9d
2 changed files with 16 additions and 2 deletions
|
@ -85,6 +85,19 @@ const scrollToElement = element => {
|
|||
window.scrollTo(0, position);
|
||||
};
|
||||
|
||||
inspector.reset = () => {
|
||||
let domTree = document.getElementById("dom-tree");
|
||||
domTree.innerHTML = "";
|
||||
|
||||
let accessibilityTree = document.getElementById("accessibility-tree");
|
||||
accessibilityTree.innerHTML = "";
|
||||
|
||||
selectedDOMNode = null;
|
||||
pendingEditDOMNode = null;
|
||||
|
||||
inspector.clearConsoleOutput();
|
||||
};
|
||||
|
||||
inspector.loadDOMTree = tree => {
|
||||
let domTree = document.getElementById("dom-tree");
|
||||
domTree.innerHTML = atob(tree);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue