@ThomDietrich is right - all you need to do is to install either Greasemonkey or TamperMonkey extension for your Chrome/Firefox/Opera and create a new script like this:
I’m not using the Classic UI but it’s really a matter of reconfiguring my script from the previous post.
Off the top of my head (and after looking up the DOM structure of webapp.net) :
@Automark This is an approach for what I mentioned, but in reality the Greasemonkey option will probably be simplest, and allow menu navigation better so I wouldn’t do it this way.
Thanks for the suggestions and examples. Finally I got around to test this with the following setup:
Windows Firefox + Tampermonkey + openHAB 1.8.3 + ClassicUI
Edit
Now both header and footer can be removed as described below.
But still it doesn’t work for a local sitemap.
I installed Tampermonkey instead of Greasmonkey because to my understanding the latter wouldn’t run on Linux which is the target system for my openHAB installation.
The code had to be modified slightly:
// ==UserScript==
// @name openHAB: Unclutter ClassicUI
// @namespace openhab
// @version 0.1
// @description Remove Header and Footer
// @author automark
// @match http://demo.webapp-net.com/*
// @match *localhost* and similar doesn't work
// @match *192.168.168.20* and similar doesn't work
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.getElementById("iHeader").remove();
document.getElementsByClassName('iFooter')[0].remove();
})();
This script is successfully applied to the demo sitemap http://demo.webapp-net.com/.
[[I didn’t get the script to remove the header so for a test I chose to remove the footer instead.]]
Also I didn’t manage to apply this script to my local sitemap with thisURL: http://localhost:8080/openhab.app?sitemap=sensors.
The remaining questions are:
What do I need to put in the @match line to catch my local sitemap?
what I did is the following - as on mobile and office devices I do not want/can install additional SW/plugins I’ve added a web view @ the end of my sitemap with the following code:
<head></head>
<body>
<script type="text/javascript">
window.parent.document.body.firstElementChild.firstElementChild.firstElementChild.style.display = "none";
// Hide the last web element of the page ...
_webViewElements = window.parent.document.body.getElementsByClassName("mdl-form__row mdl-form__row--height-auto mdl-cell mdl-cell--12-col ");
_lastWebViewElement = _webViewElements[_webViewElements.length - 1];
_lastWebViewElement.style.display = "none";
</script>
</body>