From 65f0aba0c6087740820026e59ff081f8c730411d Mon Sep 17 00:00:00 2001 From: anzz1 Date: Sat, 1 Oct 2022 20:31:19 +0300 Subject: [PATCH] improved bookmarklet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cfae2a..a1d778d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Any time you're on a Github repo you can click the bookmarklet and it'll bring up the Active Forks of that repo. ```javascript -javascript:!function(){if(title=document.title,title)if(thing=title.split(/(GitHub\s-\s)*([^:]*)/)[2],thing){var t="https://techgaun.github.io/active-forks/index.html#"+thing;window.open(t)}else window.alert("Not%20a%20valid%20GitHub%20page")}(); +javascript:(function(){if(window.location.hostname.match(/github.com+/)){var%20a=window.location.pathname.split('/',3);if(a.length==3){var%20b=encodeURIComponent(a[1]+'/'+a[2]);window.open('https://techgaun.github.io/active-forks/index.html#'+b,'_blank','noreferrer,noopener');return}}window.alert('Not%20a%20valid%20GitHub%20page')})(); ``` ![Screenshot](screenshot.png "Active Forks in Action")