Skip to content

Instantly share code, notes, and snippets.

@jareha
Created April 30, 2024 16:42
Show Gist options
  • Save jareha/6191f6df5a86d282f474dce904bb24a2 to your computer and use it in GitHub Desktop.
Save jareha/6191f6df5a86d282f474dce904bb24a2 to your computer and use it in GitHub Desktop.
Bookmarklet to search ports on MacPorts
/* jshint esversion: 8 */
(function () {
const fallback = "https://ports.macports.org/";
const keyword = "%s";
const service = "https://ports.macports.org/search/";
const suffix = "&name=on";
if (keyword !== "" || keyword !== "%" + "s") {
window.location = `${service}?q=${keyword}${suffix}`;
} else {
window.location = fallback || service;
}
})();
// javascript:(function(){const fallback="https://ports.macports.org/";const keyword="%s";const service="https://ports.macports.org/search/";const suffix="&name=on";if(keyword!==""||keyword!=="%s"){window.location=`${ service }?q=${ keyword }${ suffix }`}else{window.location=fallback||service}})();
// Minified at https://duckduckgo.com/?q=javascript+minifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment