Skip to content

A fork of ClearURLs with the goal of turning it into a reusable library

License

Notifications You must be signed in to change notification settings

thethomaswagner/url-purify

 
 

Repository files navigation

url-purify

GitHub Repo stars GitHub License NPM Version NPM Downloads

url-purify is a work-in-progress JavaScript library that cleans URLs by removing tracking parameters and other unnecessary elements. It is forked from the ClearURLs browser extension.

Usage

To use url-purify, first install it using your preferred package manager:

npm install @mkljczk/url-purify

Example usage:

import { URLPurify } from '@mkljczk/url-purify';

const purify = new URLPurify({
  hashUrl: 'https://rules2.clearurls.xyz/rules.minify.hash',
  ruleUrl: 'https://rules2.clearurls.xyz/data.minify.json',
  onFetchedRules: (_hash, _rules) => {
    const url = 'https://twitter.com/Br_Nowak/status/1586618354307039234?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1586669502292434944%7Ctwgr%5E2432a774390f7dcbd3b885ac9570cacdb3c48c9d%7Ctwcon%5Es3_&ref_url=https%3A%2F%2Fwww.wprost.pl%2Fpolityka%2F10927933%2Fkuriozalny-wpis-malopolskiej-kurator-oswiaty-przed-1-listopada-internauci-bezlitosni.html';
    const cleanUrl = purify.clearUrl(url);
    console.log(cleanUrl); // Output: 'https://twitter.com/Br_Nowak/status/1586618354307039234'
  },
});

Copyright

url-purify utilizes the ClearURLs browser extension's source code. It is licensed under the LGPL-3.0 license.

About

A fork of ClearURLs with the goal of turning it into a reusable library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%