{"id":16473122,"url":"https://github.com/binki/binki-userscript-url-unfence","last_synced_at":"2026-06-09T03:39:54.109Z","repository":{"id":250904868,"uuid":"835795152","full_name":"binki/binki-userscript-url-unfence","owner":"binki","description":"Utility for unfencing URLs fenced by various providers.","archived":false,"fork":false,"pushed_at":"2025-01-18T05:11:04.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T06:18:36.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T14:43:16.000Z","updated_at":"2025-01-18T05:11:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"2eee1ced-1c9d-45a5-a7e6-12669841f61c","html_url":"https://github.com/binki/binki-userscript-url-unfence","commit_stats":null,"previous_names":["binki/binki-userscript-url-unfence"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-url-unfence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-url-unfence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-url-unfence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbinki-userscript-url-unfence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binki","download_url":"https://codeload.github.com/binki/binki-userscript-url-unfence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241110912,"owners_count":19911411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T12:25:23.910Z","updated_at":"2026-06-09T03:39:49.082Z","avatar_url":"https://github.com/binki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Unfence/unprotect/unguard URLs from various providers.\n\nMany services will convert all external URIs in their system into links that first bring you to their own servers and then redirect you directly to the target. These services (generally?) leave the target URI visible so that links can be guarded without needing to access a database and for performance reasons. The use case of these services is to allow the services to do one of the following:\n\n* Check the URL against a blacklist of known phishing websites. (This is the claimed reason by most).\n* Show the user a landing page indicating that they are about to navigate to an external, possibly-untrusted or uncondoned website. (Uncommon, but sometimes conditionally shown when a link is copied and pasted into a browser instead of directly opened from within the website which added the fence (e.g., Messenger does this)).\n\nHowever, these links have some downsides:\n\n* When hovered, the actual target is not shown to the user.\n* In Android, this subverts Android’s Intent system in some situations, possibly preventing an app designed to handle the URL from being activated correctly.\n* This adds a dependency on a third-party and good internet connection, increasing latency when visiting the link and potentially making links which might work unusable during an outage.\n\nNote, that this is **not** meant to clean trackers from URIs. Unfencing a URI may result in reduced tracking of user activity, but removing affiliate codes, etc., is not the goal of this library.\n\n# Recognized Fences\n\nI made this script a library because I wrote multiple scripts which do unfencing. But they only supports one fencing system. I know there are many fencing systems out there, so I wanted to be able to expand my script to support “everything”. Of course, time and exposure are limited resources. I am intentionally starting this out with just a small list with the hope that I can grow it as I encounter use cases which apply to me. Please file any issues for unsupported fencing systems you come across (but note that tracker removal/URI cleaning is **not** the goal)!\n\n* Facebook Messenger `https://l.messenger.com/l.php?u=`\n* Google\n   * `https://www.google.com/url?url=`\n   * `https://www.google.com/url?q=`\n* Proofpoint URL Defense\n   * v1 `https://urldefense.proofpoint.com/v1/?url=`\n   * v2 `https://urldefense.proofpoint.com/v2/?u=http-3A__`\n   * v3 `https://urldefense.com/v3/__«url»__;!!…!…$`\n* Microsoft Outlook protection links `https://nam[0-9][0-9].safelinks.protection.outlook.com/?url=`\n\n# Usage\n\nInclude this in your userscript using [`@require`](https://wiki.greasespot.net/Metadata_Block#.40require). It is recommended to [use a permalink](https://docs.github.com/repositories/working-with-files/using-files/getting-permanent-links-to-files) instead of referring to `master`.\n\n```js\n// ==UserScript==\n// @name example\n// @version 1.0\n// @require https://github.com/binki/binki-userscript-url-unfence/raw/master/binki-userscript-url-unfence.js\n// ==UserScript==\n\n(async () =\u003e {\n  const fencedUri = 'https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbinki%2Fbinki-userscript-url-unfence\u0026data=invalid\u0026sdata=invalid\u0026reserved=0';\n  const uri = await binkiUserscriptUrlUnfenceAsync(fencedUri);\n})();\n```\n\n# API\n\n```js\nbinkiUserscriptUrlUnfence(url);\n```\n\nParameters:\n\n* `url` is the URI to unfence. It may be any URI. Any fencing iteratively removed until no known fencing is applied.\n\nNote: The API is async in case if there is ever support for unmangling links in a way which requires network access. I am unsure about whether or not that would be an acceptable use-case, but it’t be required for any amount of Twitter support, for example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fbinki-userscript-url-unfence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinki%2Fbinki-userscript-url-unfence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fbinki-userscript-url-unfence/lists"}