Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2026-02-08 23:35:53 +01:00
padre 54807b9982
commit 4b66a91750
Se han modificado 19 ficheros con 2152 adiciones y 43 borrados

Ver fichero

@@ -13,16 +13,18 @@ const DB = {
async initSQL() {
if (this.SQL) return this.SQL;
// Cargar sql.js desde CDN o localmente
// Para producción, incluir sql.js localmente
// Cargar sql.js desde archivos locales de la extensión
try {
const browserAPI = typeof browser !== "undefined" ? browser : chrome;
// Intentar cargar sql.js si no está ya cargado
if (typeof window.initSqlJs === "undefined") {
await this.loadScript("https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.8.0/sql-wasm.js");
const sqlJsUrl = browserAPI.runtime.getURL("content/sql-wasm.js");
await this.loadScript(sqlJsUrl);
}
this.SQL = await initSqlJs({
locateFile: file => `https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.8.0/${file}`
locateFile: file => browserAPI.runtime.getURL(`content/${file}`)
});
return this.SQL;