mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
fix(os): use an internal object instead of ` window.__TAURI__`, closes #719
This commit is contained in:
@@ -13,8 +13,8 @@ import { invoke } from "@tauri-apps/api/primitives";
|
||||
/** @ignore */
|
||||
declare global {
|
||||
interface Window {
|
||||
__TAURI__: {
|
||||
os: { __eol: string };
|
||||
__TAURI_OS_PLUGIN_INTERNALS__: {
|
||||
eol: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ type Arch =
|
||||
* @since 2.0.0
|
||||
* */
|
||||
function eol() {
|
||||
return window.__TAURI__.os.__eol;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.eol;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_OS__=function(n){"use strict";async function o(n,o={},e){return window.__TAURI_INTERNALS__.invoke(n,o,e)}return"function"==typeof SuppressedError&&SuppressedError,n.arch=async function(){return o("plugin:os|arch")},n.eol=function(){return window.__TAURI__.os.__eol},n.exeExtension=async function(){return o("plugin:os|exe_extension")},n.family=async function(){return o("plugin:os|family")},n.hostname=async function(){return o("plugin:os|hostname")},n.locale=async function(){return o("plugin:os|locale")},n.platform=async function(){return o("plugin:os|platform")},n.type=async function(){return o("plugin:os|os_type")},n.version=async function(){return o("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_OS__})}
|
||||
if("__TAURI__"in window){var __TAURI_OS__=function(n){"use strict";async function o(n,o={},e){return window.__TAURI_INTERNALS__.invoke(n,o,e)}return"function"==typeof SuppressedError&&SuppressedError,n.arch=async function(){return o("plugin:os|arch")},n.eol=function(){return window.__TAURI_OS_PLUGIN_INTERNALS__.eol},n.exeExtension=async function(){return o("plugin:os|exe_extension")},n.family=async function(){return o("plugin:os|family")},n.hostname=async function(){return o("plugin:os|hostname")},n.locale=async function(){return o("plugin:os|locale")},n.platform=async function(){return o("plugin:os|platform")},n.type=async function(){return o("plugin:os|os_type")},n.version=async function(){return o("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_OS__})}
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
__RAW_global_os_api__;
|
||||
|
||||
// eslint-disable-next-line
|
||||
window.__TAURI__.os.__eol = __TEMPLATE_eol__;
|
||||
Object.defineProperty(window, "__TAURI_OS_PLUGIN_INTERNALS__", {
|
||||
value: {
|
||||
eol: __TEMPLATE_eol__,
|
||||
},
|
||||
});
|
||||
|
||||
__RAW_global_os_api__;
|
||||
|
||||
Reference in New Issue
Block a user