您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name Link to Facebook Ad Library // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.facebook.com/* // @grant none // ==/UserScript== (function() { 'use strict'; let url = document.URL let re1 = /&id=(\d+)/ let re2 = /facebook\.com\/(\d+)/ let page_id1 = url.match(re1) let page_id2 = url.match(re2) console.log("page_id2",page_id1) if (page_id1) { let ad_url=`https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=${page_id1[1]}&sort_data[direction]=desc&sort_data[mode]=relevancy_monthly_grouped` window.open(ad_url, "_blank") } else { let ad_url=`https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=${page_id2[1]}&sort_data[direction]=desc&sort_data[mode]=relevancy_monthly_grouped` window.open(ad_url, "_blank") } })();