-
-
Save rominf/45073d424da3d388ccd2 to your computer and use it in GitHub Desktop.
pentadactyl command to close duplicate tabs + anchors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com -d "Delete duplicate tabs" tabcloseduplicates,tabclosed -js let seen={},vtabs=tabs.visibleTabs,i=vtabs.length;while(i--){let loc=vtabs[i].linkedBrowser.contentDocument.location.href||"";if(Object.prototype.hasOwnProperty.call(seen, loc)){config.tabbrowser.removeTab(vtabs[i]);}else{seen[loc]=true;}} | |
com -d "Delete duplicate tabs (including tabs with different view of the same page, i.e. pages with anchors)" tabcloseduplicatesanchors,tabcloseda -js let seen={},vtabs=tabs.visibleTabs,i=vtabs.length;while(i--){let loc=vtabs[i].linkedBrowser.contentDocument.location.href.replace(/#[^#]*$/, '')||"";if(Object.prototype.hasOwnProperty.call(seen, loc)){config.tabbrowser.removeTab(vtabs[i]);}else{seen[loc]=true;}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment