This is a rather very tech solution as it requires some experience in configuring Apache. The advantage is that you don't have to hack any files in the Joomla! installation itself.
Basically what I want to do is to append some HTML to any page (almost any page) being generated.
For this I will use Apache Module mod_substitute. The module itself needs to be activated (it generally just needs the # comment removed) inside
LoadModule substitute_module modules/mod_substitute.so
Next in the virtual hosts file (
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|</body>|<div style='position:fixed; left:100px; top:50px; background-color:red'><h1>DEV WEBSITE</h1></div></body>|i"
Require all granted
Allow from all
Substitute I am replacing the
</body> tag with some HTML. This way I try to stay out of any Ajax request.