1

There's a website on my uni localnet which serves an inline css for body

<body class="maincon" style="somejunk">

making it look weird. Removing inline style with the Firefox Inspector (F12) makes it look fine again but I'd like to do that automatically on every page load for this domain.

What is the simplest way to achieve that, preferably in Firefox? A Greasemonkey script? Or is there a native method?

2 Answers 2

2

Use the Greasemonkey add-on to make the following JavaScript code run on load of the page :

var x = document.getElementsByTagName("BODY")[0];
x.removeAttribute("style");

For your convenience I created a demo that shows the code in action here. Click the Run button to see it work.

To learn how to use Greasemonkey, see
The Beginner’s Guide to Greasemonkey User Scripts in Firefox.

1
  • Wow. You really went above and beyond. Thanks! Jun 22, 2017 at 20:24
1

The Firefox DevTools don't have a way to apply a change to a website everytime the page loads.

If it's really just some layout change, Stylish is the right add-on to use. And if the change also relates to functionality, a GreaseMonkey script is the way to go.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .