您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Обновление главного окна после закрытия дочернего
当前为
// ==UserScript== // @name Virtonomica: Обновление главного окна после закрытия дочернего // @namespace virtonomica // @include http*://*virtonomic*.*/*/main/unit/view/* // @description Обновление главного окна после закрытия дочернего // @version 1.6 // ==/UserScript== var run = function() { var win = (typeof(unsafeWindow) != 'undefined' ? unsafeWindow : top.window); $ = win.$; var _popup = null; function waitfor(msec, count) { // Check if condition met. If not, re-check later (msec). console.log("popup_opened = " + (_popup !== null && !_popup.closed)); while (_popup !== null && !_popup.closed) { count++; setTimeout(function() { waitfor(msec, count); }, msec); return; } _popup = null; // Condition finally met. callback() can be executed. console.log("count = " + count); location.reload(); } $('a[onclick*="doWindow(this"]').unbind().click(function(){ var matches = $(this).attr('onclick').match(/doWindow\(this[^\d]+['"]?(\d+)['"]?,\s*['"]?(\d+)['"]?\)/); var url = $(this).attr('href'); _popup = popup(url, matches[1], matches[2]); if (/\/\w+\/window\/unit\/supply\/create\/\d+\/step1\/\d+/.test(url) || /\/\w+\/window\/unit\/equipment\/\d+/.test(url)) { waitfor(500, 0); } else { _popup = null; } }); }; if(window.top == window) { var script = document.createElement("script"); script.textContent = '(' + run.toString() + ')();'; document.documentElement.appendChild(script); }