this post was submitted on 26 Jan 2024
9 points (80.0% liked)

Firefox

4119 readers
3 users here now

A community for discussion about Mozilla Firefox.

founded 1 year ago
MODERATORS
 

purpx vg bhg!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 9 months ago* (last edited 9 months ago)

Here's a bookmarklet that handles ROT13:

javascript:var a=(''+document.getSelection())||prompt("Enter text to be rot13ed","");a=a.replace(/[a-z]/gi,function(s){return String.fromCharCode(s.charCodeAt(0)+13*(('a'<=s&&s<='m'||'A'<=s&&s<='M')?+1:-1))});alert(a);

Pros: Way smaller than an extension.

Cons: Could be better written / made more extensible. May cause nerd-sniping of code golfers. May not work on other/older browsers, maybe. Uses alert.