Split fbclid

Split fbclid when open link from facebook

2020/11/02のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Split fbclid
// @author       DungGramer
// @version      1.1
// @description  Split fbclid when open link from facebook
// @homepage     https://github.com/DungGramer/split-fbclid
// @icon         https://raw.githubusercontent.com/DungGramer/skip-fbclid/main/icon.png
// @include      /((&fbclid=\w+)|(fbclid=\w+))(-\w+|)/
// @license      CC-BY-SA-3.0; http://creativecommons.org/licenses/by-sa/3.0/
// @license      MIT
// @grant        none
// @copyright    2020, DungGramer
// @namespace https://www.facebook.com/dung.dev.gramer/
// ==/UserScript==

(function () {
  let newURL = window.location.href.split(/((&fbclid=\w+)|(fbclid=\w+))(-\w+|)/);
  let newHref = newURL[0].match(/\?\w+/) != null ? decodeURIComponent(newURL[0]) : newURL[0].split(/\?/)[0];
  if (newURL[newURL.length - 1].match(/-\w+/) != null) {
    window.location = decodeURIComponent(newHref);
  }
  else {
    window.location = decodeURIComponent(newHref + newURL[newURL.length - 1]);
  }
})();