-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61d2c0d
commit c10d872
Showing
25 changed files
with
573 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
{ | ||
"name": "ropeswing", | ||
"description": "ropeswing kernel modifications", | ||
"scripts": { | ||
"build": "node build.mjs", | ||
"dev": "node build.mjs --dev" | ||
}, | ||
"author": "Beef", | ||
"license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"chokidar": "^3.5.3", | ||
"colorette": "^2.0.20", | ||
"esbuild": "^0.18.11", | ||
"esbuild-plugin-alias": "^0.2.1", | ||
"esbuild-sass-plugin": "^2.10.0", | ||
"listhen": "^1.0.4", | ||
"postcss": "^8.4.26", | ||
"postcss-modules": "^6.0.0", | ||
"typescript": "^5.1.6" | ||
}, | ||
"dependencies": { | ||
"spitroast": "^1.4.3", | ||
"voby": "^0.54.0" | ||
} | ||
"name": "ropeswing", | ||
"description": "ropeswing kernel modifications", | ||
"scripts": { | ||
"build": "node build.mjs", | ||
"dev": "node build.mjs --dev" | ||
}, | ||
"author": "Beef", | ||
"license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"chokidar": "^3.5.3", | ||
"colorette": "^2.0.20", | ||
"esbuild": "^0.18.11", | ||
"esbuild-plugin-alias": "^0.2.1", | ||
"esbuild-sass-plugin": "^2.10.0", | ||
"listhen": "^1.0.4", | ||
"postcss": "^8.4.26", | ||
"postcss-modules": "^6.0.0", | ||
"typescript": "^5.1.6" | ||
}, | ||
"dependencies": { | ||
"spitroast": "^1.4.3", | ||
"voby": "^0.54.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
import { extensions } from "@ext/all"; | ||
|
||
export function contextify(replace: Replacer, extName: string): Replacer { | ||
const self = `ropeswing.extensions["${extName}"]`; | ||
switch (typeof replace) { | ||
case "string": | ||
return replace.replaceAll("$self", self); | ||
case "function": | ||
return (...args) => replace(...args).replaceAll("$self", self); | ||
} | ||
const self = `ropeswing.extensions["${extName}"]`; | ||
switch (typeof replace) { | ||
case "string": | ||
return replace.replaceAll("$self", self); | ||
case "function": | ||
return (...args) => replace(...args).replaceAll("$self", self); | ||
} | ||
} | ||
|
||
export function applyPatches(mainScript: HTMLScriptElement) { | ||
if (!mainScript.textContent) throw new Error("Script doesn't have textContent, what?"); | ||
|
||
console.group("[ ropeswing-patcher ]"); | ||
|
||
for (let extension of extensions) { | ||
if (!extension.patches) continue; | ||
for (let patch of extension.patches) { | ||
if (patch.executable) continue; | ||
// TODO: Using `as string` is bad, but TypeScript wasn't having it with my replace typings, and this works | ||
mainScript.textContent = mainScript.textContent.replace(patch.find, contextify(patch.replace, extension.manifest.name) as string); | ||
console.log(`applied patch ${extension.patches.indexOf(patch) + 1} of ${extension.patches.length} from ${extension.manifest.name}`); | ||
} | ||
} | ||
|
||
console.groupEnd(); | ||
if (!mainScript.textContent) throw new Error("Script doesn't have textContent, what?"); | ||
|
||
console.group("[ ropeswing-patcher ]"); | ||
|
||
for (let extension of extensions) { | ||
if (!extension.patches) continue; | ||
|
||
for (let patch of extension.patches) { | ||
if (patch.executable) continue; | ||
// TODO: Using `as string` is bad, but TypeScript wasn't having it with my replace typings, and this works | ||
mainScript.textContent = mainScript.textContent.replace(patch.find, contextify(patch.replace, extension.manifest.name) as string); | ||
console.log(`applied patch ${extension.patches.indexOf(patch) + 1} of ${extension.patches.length} from ${extension.manifest.name}`); | ||
} | ||
} | ||
|
||
console.groupEnd(); | ||
} | ||
|
||
export function executePostload() { | ||
console.group("[ ropeswing-postload ]"); | ||
console.group("[ ropeswing-postload ]"); | ||
|
||
for (let extension of extensions) { | ||
if (!extension.onLoad) continue; | ||
for (let extension of extensions) { | ||
if (!extension.onLoad) continue; | ||
|
||
extension.onLoad(); | ||
console.log(`executed onLoad of ${extension.manifest.name}`); | ||
} | ||
extension.onLoad(); | ||
console.log(`executed onLoad of ${extension.manifest.name}`); | ||
} | ||
|
||
console.groupEnd(); | ||
console.groupEnd(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { defineExt } from "@lib/utils" | ||
import { defineExt } from "@lib/utils"; | ||
|
||
export default defineExt({ | ||
patches: [ | ||
{ | ||
executable: "C:/system/local/bin/shell36", | ||
find: /document\.addEventListener\("keydown",/, | ||
replace: () => "(", | ||
}, | ||
], | ||
manifest: { | ||
name: "forcereboot", | ||
description: "Removes the reboot confirmation when pressing Ctrl+R or F5", | ||
authors: ["redstonekasi"], | ||
}, | ||
patches: [ | ||
{ | ||
executable: "C:/system/local/bin/shell36", | ||
find: /document\.addEventListener\("keydown",/, | ||
replace: () => "(", | ||
}, | ||
], | ||
manifest: { | ||
name: "forcereboot", | ||
description: "Removes the reboot confirmation when pressing Ctrl+R or F5", | ||
authors: ["redstonekasi"], | ||
}, | ||
}); |
Oops, something went wrong.