Greasy Fork is available in English.

Discussioni » Sviluppo

Removing form buttons from a phpbb forum reply editor

Pubblicato: 12/12/2022

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

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. I found a promising JS function on here ( 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.
  • or maybe there is already a script that I can use or build upon?

Thanks in advance!

Pubblica risposta

Accedi per pubblicare una risposta.