forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
42 lines (39 loc) · 1.03 KB
/
Copy pathmain.js
File metadata and controls
42 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import "./reset.css";
import "@shared/variables.css";
import "./app.css";
import { mount } from "svelte";
import App from "./App.svelte";
if (import.meta.env.MODE === "development") {
// Simulation in non-WkWebView dev environment
if (import.meta.env.SAFARI_PLATFORM === undefined) {
console.warn("Simulation webkit...");
window.webkit = {
messageHandlers: {
controller: {
postMessage: async (message) => {
switch (message) {
case "INIT":
return {
build: "2",
directory: "Userscripts App Documents",
enableLogger: true,
extStatus: "unknown",
firstRunTime: 1,
maxLogFileSize: 500_000_000,
platform: "mac",
promptLogger: true,
useSettingsInsteadOfPreferences: true,
version: "2.0.0",
};
default:
console.debug("Simulation.webkit.messageHandler:", message);
break;
}
},
},
},
};
}
}
const app = mount(App, { target: document.getElementById("app") });
export default app;