Auto-grant works only for GM_API
7nik opened this issue · comments
The following code
import { monkeyWindow } from "$";
if (monkeyWindow.onurlchange === null) {
monkeyWindow.addEventListener("urlchange", console.log);
}
monkeyWindow.focus();
monkeyWindow.close();
// @ts-expect-error
monkeyWindow.unsafeWindow.test = 42;
built with default config outputs
// ==UserScript==
// @name us-test
// @namespace npm/vite-plugin-monkey
// @version 0.0.0
// @author monkey
// @icon https://vitejs.dev/logo.svg
// @match https://www.google.com/
// ==/UserScript==
(function () {
'use strict';
var _monkeyWindow = /* @__PURE__ */ (() => window)();
if (_monkeyWindow.onurlchange === null) {
_monkeyWindow.addEventListener("urlchange", console.log);
}
_monkeyWindow.focus();
_monkeyWindow.close();
_monkeyWindow.unsafeWindow.test = 42;
})();
which doesn't contain any of corresponding @grant
's.