mirror of
https://wiilab.wiimart.org/wiimart/wiimart-extension
synced 2025-09-03 20:11:04 +02:00
changes
This commit is contained in:
parent
2cdfb1e912
commit
ff645bd4a6
@ -11,28 +11,21 @@ function blockRequest(details) {
|
|||||||
|
|
||||||
// Check if the browser is Firefox or Chrome
|
// Check if the browser is Firefox or Chrome
|
||||||
const isFirefox = typeof browser !== "undefined";
|
const isFirefox = typeof browser !== "undefined";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// background.js
|
// background.js
|
||||||
|
|
||||||
// Listen for web requests
|
// Handle all miip:// requests
|
||||||
chrome.webRequest.onBeforeRequest.addListener(
|
chrome.webRequest.onBeforeRequest.addListener(
|
||||||
function(details) {
|
function(details) {
|
||||||
// Check if the URL matches the pattern
|
console.log("[DEBUG] Intercepted URL:", details.url);
|
||||||
const urlPattern = /^miip:\/\/CID\/.*\.bmp\?width=48&height=48&bgR=\d{1,3}&bgG=\d{1,3}&bgB=\d{1,3}$/;
|
|
||||||
if (urlPattern.test(details.url)) {
|
if (details.url.startsWith('miip://')) {
|
||||||
// Redirect to the image stored in the extension
|
const redirectUrl = chrome.runtime.getURL("images/mii.bmp");
|
||||||
return { redirectUrl: chrome.runtime.getURL("images/mii.bmp") };
|
console.log("[DEBUG] Redirecting to:", redirectUrl);
|
||||||
|
return { redirectUrl: redirectUrl };
|
||||||
}
|
}
|
||||||
|
return {};
|
||||||
},
|
},
|
||||||
{ urls: [
|
{ urls: ["<all_urls>"] },
|
||||||
"https://oss-auth.blinklab.com/*",
|
|
||||||
"https://oss-auth.thecheese.io/*",
|
|
||||||
"https://oss-auth.shop.wii.com/*",
|
|
||||||
"http://wiimart:8080/oss/serv/*",
|
|
||||||
"https://wiimart:8080/oss/serv/*"
|
|
||||||
]}, // You can restrict this to specific URLs if needed
|
|
||||||
["blocking"]
|
["blocking"]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -205,7 +205,17 @@ class ECommerceInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkDeviceStatus() {
|
checkDeviceStatus() {
|
||||||
return 1;
|
return {
|
||||||
|
status: 0,
|
||||||
|
operation: "checkDeviceStatus",
|
||||||
|
description: "",
|
||||||
|
phase: 17,
|
||||||
|
isCancelRequested: "false",
|
||||||
|
downloadedSize: 888,
|
||||||
|
totalSize: 888,
|
||||||
|
errCode: "",
|
||||||
|
errInfo: "",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeviceInfo() {
|
getDeviceInfo() {
|
||||||
@ -368,20 +378,22 @@ class wiiNwc24 {
|
|||||||
fnm = parsedValue; // Convert string to integer
|
fnm = parsedValue; // Convert string to integer
|
||||||
}
|
}
|
||||||
if (data == "name") {
|
if (data == "name") {
|
||||||
if (fnm == 1) {
|
if (fnm == 0) {
|
||||||
return "User1";
|
return "User1";
|
||||||
} else if (fnm == 2) {
|
} else if (fnm == 1) {
|
||||||
return "User2";
|
return "User2";
|
||||||
} else if (fnm == 3) {
|
} else if (fnm == 2) {
|
||||||
return "User3";
|
return "User3";
|
||||||
} else if (fnm == 4) {
|
} else if (fnm == 3) {
|
||||||
return "User4";
|
return "User4";
|
||||||
} else if (fnm == 5) {
|
} else if (fnm == 4) {
|
||||||
return "User5";
|
return "User5";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data == "userId") {
|
if (data == "userId") {
|
||||||
if (fnm == 1) {
|
if (fnm == 0) {
|
||||||
|
return "3630753603591712";
|
||||||
|
} else if (fnm == 1) {
|
||||||
return "3630753603591712";
|
return "3630753603591712";
|
||||||
} else if (fnm == 2) {
|
} else if (fnm == 2) {
|
||||||
return "3630753603591712";
|
return "3630753603591712";
|
||||||
@ -389,8 +401,6 @@ class wiiNwc24 {
|
|||||||
return "3630753603591712";
|
return "3630753603591712";
|
||||||
} else if (fnm == 4) {
|
} else if (fnm == 4) {
|
||||||
return "3630753603591712";
|
return "3630753603591712";
|
||||||
} else if (fnm == 5) {
|
|
||||||
return "3630753603591712";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data == "miiImage") {
|
if (data == "miiImage") {
|
||||||
@ -406,10 +416,15 @@ class wiiDlTask {
|
|||||||
trace("yes i got it dw i will download it :tro:");
|
trace("yes i got it dw i will download it :tro:");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
class wiiMii {
|
||||||
|
constructor() {
|
||||||
|
trace("wiiMii init");
|
||||||
|
}
|
||||||
|
}
|
||||||
window.ECommerceInterface = ECommerceInterface;
|
window.ECommerceInterface = ECommerceInterface;
|
||||||
window.ECCreditCardEncryptedPayment = ECCreditCardEncryptedPayment;
|
window.ECCreditCardEncryptedPayment = ECCreditCardEncryptedPayment;
|
||||||
window.ECPrice = ECPrice;
|
window.ECPrice = ECPrice;
|
||||||
window.wiiKeyboard = wiiKeyboard;
|
window.wiiKeyboard = wiiKeyboard;
|
||||||
window.wiiShop = wiiShop;
|
window.wiiShop = wiiShop;
|
||||||
window.wiiSound = wiiSound;
|
window.wiiSound = wiiSound;
|
||||||
|
window.wiiMii = wiiMii;
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
{
|
{
|
||||||
"resources": [
|
"resources": [
|
||||||
"fonts/*",
|
"fonts/*",
|
||||||
|
"images/*",
|
||||||
"classDefinitions.js"
|
"classDefinitions.js"
|
||||||
],
|
],
|
||||||
"matches": [
|
"matches": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user