Bookmarklets

Copyright 2023 Yawar Amin

This file is part of bookmarklets.

bookmarklets is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

bookmarklets is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with bookmarklets. If not, see https://www.gnu.org/licenses/.

ℹī¸ The bookmarklets' source code in this page are in a minified form. To get the original code, go to the GitHub repo.

To install each bookmarklet, simply drag and drop its link to your browser's Bookmarks bar.

Anchors toggle

Show or hide all anchors (elements with id or name attributes) on the page.

anchors toggle

BitBucket comments minimize

In BitBucket PRs, some workflows (or long-winded reviews) can pile up a lot of comments. Unfortunately, you have to scroll past all the comments to get to the diff. It's much easier to do that if all the comments are automatically collapsed and can be expanded with a click. This collapses (minimizes) the PR comments.

bitbucket comments min

BitBucket merge

In BitBucket PRs, when you have the 'squash merge' feature enabled (which you really should), the default commit message is formatted really badly:

Merged in your-branch (pull request #nnn)

Real first line

Other lines

So when you do git log --oneline, the one-line summary logs are full of inscrutable 'Merged in...' messages which don't describe the actual commits themselves. This is a long-standing issue known to BitBucket: https://jira.atlassian.com/browse/BCLOUD-19402.

This bookmarklet fixes the message to look like this:

Real first line (PR #nnn)

Other lines

Then it copies the fixed text to the clipboard and asks you to paste it into the commit message textbox. Unfortunately this extra step seems unavoidable because of the way the BitBucket textbox is designed. But it works fairly well. To use it, you click on the bookmarklet instead of clicking on the PR's 'Merge' button. Then you do a paste operation, and click the dialog box's 'Merge' button.

bitbucket merge

Show external links on the page visually. Suffixes the text of the hyperlink with its hostname.

ext links

Home page

Go to this site's home page.

home page

Odoc index

If you are viewing an odoc-generated OCaml documentation module page like this, this bookmarklet will generate an alphabetically-sorted index of the contents of the module, and inject it into the left sidebar.

odoc idx

Paste enable

Some very annoying websites disable the paste functionality on some of their inputs by hijacking the paste event. This re-enables paste functionality.

paste enable

Scroll toggle

Scroll to the top or bottom of the page.

scroll toggle

Sticky kill

Kill sticky elements that hide parts of the page beneath them.

ℹī¸ Go to https://github.com/t-mart/kill-sticky to install this bookmarklet.

URL decrement

Decrement the last number in the URL and navigate to the resulting page.

url decr

URL increment

Increment the last number in the URL and navigate to the resulting page.

url incr

Whois lookup

Do a WHOIS lookup of the current domain.

whois