handle domains written as "domain dot tld"

This commit is contained in:
Holly 2021-09-23 17:04:05 +00:00
parent 76ac48053d
commit 600580c3bb
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Remote Instance Actions // @name Remote Instance Actions
// @namespace https://hollymcfarland.com // @namespace https://hollymcfarland.com
// @version 1.0 // @version 1.1
// @description Easily limit a remote instance from your Mastodon instance via the timeline // @description Easily limit a remote instance from your Mastodon instance via the timeline
// @author monorail // @author monorail
<?php <?php
@ -63,6 +63,9 @@
// clear out accidental whitespace // clear out accidental whitespace
domain = domain.trim(); domain = domain.trim();
// in case it's written like "domain dot tld"
domain = domain.replace(/\s+dot\s+/, ".");
// in case a full link was provided // in case a full link was provided
domain = domain.replace(/https?:\/\//, ""); domain = domain.replace(/https?:\/\//, "");