diff --git a/src/lib/webengine/webinspector.cpp b/src/lib/webengine/webinspector.cpp index 1b222b07b..f0b4ac47b 100644 --- a/src/lib/webengine/webinspector.cpp +++ b/src/lib/webengine/webinspector.cpp @@ -115,18 +115,11 @@ void WebInspector::loadFinished() { // Show close button only when docked if (!isWindow()) { - page()->runJavaScript(QL1S("var toolbar = document.getElementsByClassName('inspector-view-toolbar')[1];" - "var button = document.createElement('button');" - "button.style.width = '22px';" - "button.style.height = '22px';" - "button.style.border = 'none';" - "button.style.cursor = 'pointer';" - "button.style.background = 'url(qrc:html/close.png) no-repeat';" - "button.style.backgroundPosition = 'center center';" - "button.addEventListener('click', function() {" + page()->runJavaScript(QL1S("var button = Components.dockController._closeButton;" + "button.setVisible(true);" + "button.element.onmouseup = function() {" " window.close();" - "});" - "toolbar.appendChild(button);")); + "};")); } // Inspect element