I think it’s probably quite difficult to fully implement. The actual substitution of the kanji by kana is probably the easy part. If you’re OK with something like a simple userscript, you could in theory just scan the entire text in the body of the page, scanning the entire page for any text nodes, taking their text out, figure out the kana and substitute the text on the page by the kana version by simply setting the original text node’s contents to the new kana version. Whether or not you decide to substitute everything or only a specific dictionary doesn’t really matter from a technical standpoint there, that’s just a case of figuring out what to leave in. It might mess up the page layout a bit as the kana version will probably take up a lot more space than the kanji version.
The hardest part of the process is actually just the language itself. Figuring out the readings from a pure text string is quite hard, especially since a lot of Japanese text doesn’t really have clear spaces in it to mark word boundaries. You’d essentially have to parse the entire text or sentence, and try to figure out the words used based on the grammar present, which is quite difficult to do reliably. What makes it even worse is that Japanese websites are notoriously more difficult to extract a full coherent text from than most English websites. Sites using furigana will often have their text internally broken up from an HTML standpoint (e.g. 読む will usually be encoded as <ruby>読<rb>よ</rb></ruby>む), meaning parsing out a full word might even be hard. To solve this you could probably handle ruby and rt tags as special cases and substitute them by their rt content, although it still makes parsing the text a lot more difficult. A lot of Japanese websites I’ve come across also have a tendency to use images for banners or other site headings, which would be nearly impossible to parse normally, although this would not be too different from the problems most other Japanese language support plugins currently have.
Your best bet would probably be what @seanblue described earlier, finding an open-source plugin that does something similar, and seeing if you can at least fork the parsing part. If you have something that can parse a webpage, simply adding something to block out a set of kanji will probably not be too hard. I searched around a bit and found https://github.com/kuanyui/Furiganaize, which seems to be an open-source furigana plugin for firefox. The text_to_furigana_dom_parse.js file seems to handle the actual kanji substitution, and you could probably use it as a starting point, although from what I can tell it does still lack a lot of features the larger furigana plugins seem to have, and the code documentation isn’t that great. The code is small enough that you could probably write a toy example of the plugin you want to write relatively easy.