调试时阻止页面跳转

try to take over the world!

// ==UserScript==
// @name         调试时阻止页面跳转
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       dingjz
// @match        http://*/*
// @match        https://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onbeforeunload = function(event) {
        console.log(event);
        debugger
        return false;
    }
    // Your code here...
})();