Prep for addon signing

This commit is contained in:
2025-11-12 15:53:45 -05:00
parent 1eb30b4689
commit 4fc0210529
11 changed files with 356 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
import { CreateMLCEngine } from "@mlc-ai/web-llm";
import { CreateMLCEngine } from "@mlc-ai/web-llm"
var engine = null
var resume = ""
@@ -12,7 +12,7 @@ const loadProgress = (progress) => {
const loadResources = async () => {
let modelName = (await browser.storage.local.get("model")).model || "Llama-3.2-1B-Instruct-q4f32_1-MLC"
console.log(`Loading model: ${modelName}`)
engine = await CreateMLCEngine(modelName, { initProgressCallback: loadProgress });
engine = await CreateMLCEngine(modelName, { initProgressCallback: loadProgress })
console.log("Model loaded")
resume = (await browser.storage.local.get("resume")).resume || "No resume, halt and ask for resume."
resourcesLoaded = true
@@ -44,7 +44,7 @@ browser.contextMenus.create({
browser.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "nms-cmenu" && info.selectionText) {
// Handle context menu click with selected text
console.log("Context menu clicked with selection:", info.selectionText);
console.log("Context menu clicked with selection:", info.selectionText)
runMatch(info.selectionText)
}
})