0

I'd like to remove or disable a couple of buttons from the reply editor of a phpbb forum I'm a member of, because the bbcodes they insert are too tempting but for some reason reserved for "more mortals".

Removing is probably the easiest solution; I have already identified what code to remove to achieve this:

</button>
    <button type="button" class="button button-secondary bbcode-anchor" name="addbbcode24" value="anchor" onclick="bbstyle(24)" title="Anchor: [anchor]Name of the anchor[/anchor]">
    anchor
</button>
    <button type="button" class="button button-secondary bbcode-goto" name="addbbcode26" value="goto" onclick="bbstyle(26)" title="Goto: [goto=Anchor Name]Link tekst[/goto]">
    goto
</button>

In the old days I would do this via a filter in Privoxy but nowadays that requires setting up its https_inspection, which I'd prefer to avoid.

I think it should be possible to do this via an in-browser userscript, e.g. via Tampermonkey. I found a promising JS function on here (https://stackoverflow.com/a/50537862/1460868) but have little idea for now how to deploy it (I have no knowledge of Javascript):

  • the function uses node.textContent.replace(); does it take simple expression (if so, how to pass a multi-line pattern?) or a regexp (and if so, what flavour)?
  • some guidelines/pointers as to how to put this function in a user.js/tampermonkey script would be appreciated.

Thanks in advance!

RJVB
  • 698
  • 8
  • 18

0 Answers0