v3's basic structure
BIN
v3/data/icons/128.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
v3/data/icons/16.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
v3/data/icons/18.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
v3/data/icons/19.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
v3/data/icons/256.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
v3/data/icons/32.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
v3/data/icons/36.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
v3/data/icons/38.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
v3/data/icons/48.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
v3/data/icons/512.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
v3/data/icons/64.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
v3/data/icons/active/128.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
v3/data/icons/active/16.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
v3/data/icons/active/18.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
v3/data/icons/active/19.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
v3/data/icons/active/256.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
v3/data/icons/active/32.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
v3/data/icons/active/36.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
v3/data/icons/active/38.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
v3/data/icons/active/48.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
v3/data/icons/active/512.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
v3/data/icons/active/64.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
v3/data/icons/ignored/128.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
v3/data/icons/ignored/16.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
v3/data/icons/ignored/18.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
v3/data/icons/ignored/19.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
v3/data/icons/ignored/256.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
v3/data/icons/ignored/32.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
v3/data/icons/ignored/36.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
v3/data/icons/ignored/38.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
v3/data/icons/ignored/48.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
v3/data/icons/ignored/512.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
v3/data/icons/ignored/64.png
Normal file
After Width: | Height: | Size: 5 KiB |
17
v3/data/inject/isolated.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const port = document.createElement('span');
|
||||
port.id = 'ua-port-fgTd9n';
|
||||
document.documentElement.append(port);
|
||||
|
||||
// preferences
|
||||
self.prefs = self.prefs || {
|
||||
ua: 'Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
|
||||
uad: true,
|
||||
major: 100,
|
||||
name: 'Google Chrome',
|
||||
mobile: false,
|
||||
platform: 'Windows',
|
||||
architecture: 'x86',
|
||||
bitness: '64',
|
||||
platformVersion: '10.0.0'
|
||||
};
|
||||
Object.assign(port.dataset, self.prefs);
|
102
v3/data/inject/main.js
Normal file
|
@ -0,0 +1,102 @@
|
|||
const port = document.getElementById('ua-port-fgTd9n');
|
||||
port.remove();
|
||||
console.log(12, port);
|
||||
|
||||
// overwrite navigator.userAgent
|
||||
{
|
||||
const {get} = Object.getOwnPropertyDescriptor(Navigator.prototype, 'userAgent');
|
||||
|
||||
Object.defineProperty(Navigator.prototype, 'userAgent', {
|
||||
get: new Proxy(get, {
|
||||
apply() {
|
||||
return port.dataset.ua;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// overwrite navigator.userAgentData
|
||||
if (port.dataset.uad) {
|
||||
self.NavigatorUAData = self.NavigatorUAData || new class NavigatorUAData {
|
||||
brands = [];
|
||||
mobile = false;
|
||||
platform = 'Unknown';
|
||||
toJSON() {
|
||||
return {};
|
||||
}
|
||||
getHighEntropyValues() {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
};
|
||||
|
||||
Object.defineProperty(self.NavigatorUAData.prototype, 'brands', {
|
||||
get: new Proxy(Object.getOwnPropertyDescriptor(self.NavigatorUAData.prototype, 'brands').get, {
|
||||
apply() {
|
||||
return [{
|
||||
brand: port.dataset.name,
|
||||
version: port.dataset.major
|
||||
}, {
|
||||
brand: 'Chromium',
|
||||
version: port.dataset.major
|
||||
}, {
|
||||
brand: 'Not=A?Brand',
|
||||
version: '24'
|
||||
}];
|
||||
}
|
||||
})
|
||||
});
|
||||
Object.defineProperty(self.NavigatorUAData.prototype, 'mobile', {
|
||||
get: new Proxy(Object.getOwnPropertyDescriptor(self.NavigatorUAData.prototype, 'mobile').get, {
|
||||
apply() {
|
||||
return port.dataset.mobile === 'true';
|
||||
}
|
||||
})
|
||||
});
|
||||
Object.defineProperty(self.NavigatorUAData.prototype, 'platform', {
|
||||
get: new Proxy(Object.getOwnPropertyDescriptor(self.NavigatorUAData.prototype, 'platform').get, {
|
||||
apply() {
|
||||
return port.dataset.platform;
|
||||
}
|
||||
})
|
||||
});
|
||||
self.NavigatorUAData.prototype.toJSON = new Proxy(self.NavigatorUAData.prototype.toJSON, {
|
||||
apply(target, self) {
|
||||
return {
|
||||
brands: self.brands,
|
||||
mobile: self.mobile,
|
||||
platform: self.platform
|
||||
};
|
||||
}
|
||||
});
|
||||
self.NavigatorUAData.prototype.getHighEntropyValues = new Proxy(self.NavigatorUAData.prototype.getHighEntropyValues, {
|
||||
apply(target, self, args) {
|
||||
const hints = args[0];
|
||||
|
||||
if (!hints || Array.isArray(hints) === false) {
|
||||
return Promise.reject(Error(`Failed to execute 'getHighEntropyValues' on 'NavigatorUAData'`));
|
||||
}
|
||||
|
||||
const r = self.toJSON();
|
||||
|
||||
if (hints.includes('architecture')) {
|
||||
r.architecture = port.dataset.architecture;
|
||||
}
|
||||
if (hints.includes('bitness')) {
|
||||
r.bitness = port.dataset.bitness;
|
||||
}
|
||||
if (hints.includes('model')) {
|
||||
r.model = '';
|
||||
}
|
||||
if (hints.includes('platformVersion')) {
|
||||
r.platformVersion = port.dataset.platformVersion;
|
||||
}
|
||||
if (hints.includes('uaFullVersion')) {
|
||||
r.uaFullVersion = self.brands[0].version;
|
||||
}
|
||||
if (hints.includes('fullVersionList')) {
|
||||
r.fullVersionList = this.brands;
|
||||
}
|
||||
return Promise.resolve(r);
|
||||
}
|
||||
});
|
||||
}
|