Bypass taobao overseas block(绕过淘宝屏蔽海外用户)

当访问禁止出口的淘宝商品时,取消自动跳转

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Bypass taobao overseas block(绕过淘宝屏蔽海外用户)
// @description  当访问禁止出口的淘宝商品时,取消自动跳转
// @icon         https://img.alicdn.com/favicon.ico
// @version      0.2.1
// @author       foomango
// @match        *item.taobao.com/*
// @match        *detail.tmall.com/*
// @grant        none
// @namespace    https://greasyfork.org/users/705411-foomango
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';
    console.log('Loading bypass-taobao-overseas-block.js')
    const beforeUnloadListener = (event) => {
        event.preventDefault()

        // Only prevent page redirection fired by Taotao
        removeEventListener('beforeunload', beforeUnloadListener, {capture: true})
        /*eslint-disable */
        return event.returnValue = 'Are you sure you want to exit?'
        /*eslint-enable */
    }
    alert('点击确定(OK)按钮后,请在屏幕上快速移动并随机连续点击几次。')
    addEventListener('beforeunload', beforeUnloadListener, {capture: true});

    console.log('Finish loading bypass-taobao-overseas-block.js')
})();