@@ -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;
|
||||
|
||||
Referencia en una nueva incidencia
Block a user