Fix bookmarklet for Firefox users.

In firefox, if the bookmarklet returns something, the page contents will be replaced by it. In this case, the bookmarklet returns a Window object, replacing the original contents with "[object Window]".
Source: https://stackoverflow.com/questions/2774453
This commit is contained in:
L 2025-03-06 20:06:37 +00:00
parent b7c868b127
commit 2c1adab75d

View file

@ -29,7 +29,7 @@ const About = props => {
</p>
<p>
<b>PC Usage</b>: Press Ctrl-Shift-B to view the bookmark bar, and then drag this bookmarklet:
<a className='bookmarklet' href='javascript:window.open(location.href.replace(/:\/\/([\w-]+.)?(reddit\.com\/r|reveddit\.com\/v)\//i, "://www.unddit.com/r/"), "_blank")'>
<a className='bookmarklet' href='javascript:void(window.open(location.href.replace(/:\/\/([\w-]+.)?(reddit\.com\/r|reveddit\.com\/v)\//i, "://www.unddit.com/r/"), "_blank"))'>
Unddit
</a>
to the bar and click it when viewing a Reddit post.