Replace main.js

This commit is contained in:
#deCloudflare 2022-08-26 11:00:24 +00:00
parent a3bba4dee7
commit e0cd6101d3

View File

@ -2198,6 +2198,23 @@ browser.webNavigation.onCompleted.addListener(() => {
});
});
browser.runtime.onMessage.addListener((r, s, sr) => {
if (r[0] == 'iidCACHEget') {
let iidDOMAIN = get_realdomain(r[1]) + '.mpdns_iid';
if (domainCAT[iidDOMAIN]) {
sr([true, domainCAT[iidDOMAIN][1]]);
} else {
sr([false, 0]);
}
}
if (r[0] == 'iidCACHEset') {
let iidDOMAIN = get_realdomain(r[1]) + '.mpdns_iid';
if (!domainCAT[iidDOMAIN]) {
domainCAT[iidDOMAIN] = [tUNIX(), r[2],
[]
];
}
sr(true);
}
if (r[0] == 'set') {
token = r[1];
if (token.length == 20) {
@ -2273,4 +2290,4 @@ browser.runtime.onInstalled.addListener(g => {
browser.runtime.openOptionsPage();
showreply('Hello!', 'Please set your token to begin.');
}
});
});