mirror of
https://github.com/titaniumnetwork-dev/Ultraviolet.git
synced 2025-05-16 04:50:01 -04:00
Almost done!
This commit is contained in:
parent
da5c0c88b1
commit
355e87dd21
13 changed files with 262 additions and 38 deletions
|
@ -43,6 +43,7 @@ class HTML extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|||
this.iterate(ast, fn, options);
|
||||
return (0,parse5__WEBPACK_IMPORTED_MODULE_1__.serialize)(ast);
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
return str;
|
||||
};
|
||||
};
|
||||
|
@ -35773,7 +35774,7 @@ function injectHead(ctx) {
|
|||
});
|
||||
};
|
||||
|
||||
function createInjection(handler = '/uv.handler.js', bundle = '/uv.bundle.js', cookies = '', referrer = '') {
|
||||
function createInjection(handler = '/uv.handler.js', bundle = '/uv.bundle.js', config = '/uv.config.js', cookies = '', referrer = '') {
|
||||
return [
|
||||
{
|
||||
tagName: 'script',
|
||||
|
@ -35784,7 +35785,13 @@ function createInjection(handler = '/uv.handler.js', bundle = '/uv.bundle.js', c
|
|||
value: `window.__uv$cookies = atob("${btoa(cookies)}");\nwindow.__uv$referrer = atob("${btoa(referrer)}");`
|
||||
},
|
||||
],
|
||||
attrs: [],
|
||||
attrs: [
|
||||
{
|
||||
name: '__uv-script',
|
||||
value: '1',
|
||||
skip: true,
|
||||
}
|
||||
],
|
||||
skip: true,
|
||||
},
|
||||
{
|
||||
|
@ -35792,7 +35799,12 @@ function createInjection(handler = '/uv.handler.js', bundle = '/uv.bundle.js', c
|
|||
nodeName: 'script',
|
||||
childNodes: [],
|
||||
attrs: [
|
||||
{ name: 'src', value: bundle, skip: true }
|
||||
{ name: 'src', value: bundle, skip: true },
|
||||
{
|
||||
name: '__uv-script',
|
||||
value: '1',
|
||||
skip: true,
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -35800,9 +35812,27 @@ function createInjection(handler = '/uv.handler.js', bundle = '/uv.bundle.js', c
|
|||
nodeName: 'script',
|
||||
childNodes: [],
|
||||
attrs: [
|
||||
{ name: 'src', value: handler, skip: true }
|
||||
{ name: 'src', value: config, skip: true },
|
||||
{
|
||||
name: '__uv-script',
|
||||
value: '1',
|
||||
skip: true,
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
tagName: 'script',
|
||||
nodeName: 'script',
|
||||
childNodes: [],
|
||||
attrs: [
|
||||
{ name: 'src', value: handler, skip: true },
|
||||
{
|
||||
name: '__uv-script',
|
||||
value: '1',
|
||||
skip: true,
|
||||
}
|
||||
],
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -38861,6 +38891,7 @@ class StyleApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|||
this.cssStyleProto = this.CSSStyleDeclaration.prototype || {};
|
||||
this.getPropertyValue = this.cssStyleProto.getPropertyValue || null;
|
||||
this.setProperty = this.cssStyleProto.setProperty || null;
|
||||
this.cssText - ctx.nativeMethods.getOwnPropertyDescriptors(this.cssStyleProto, 'cssText');
|
||||
this.urlProps = ['background', 'backgroundImage', 'borderImage', 'borderImageSource', 'listStyle', 'listStyleImage', 'cursor'];
|
||||
this.dashedUrlProps = ['background', 'background-image', 'border-image', 'border-image-source', 'list-style', 'list-style-image', 'cursor'];
|
||||
this.propToDashed = {
|
||||
|
@ -38896,6 +38927,24 @@ class StyleApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|||
return event.target.call(event.that, event.data.property, event.data.value);
|
||||
});
|
||||
};
|
||||
overrideCssText() {
|
||||
this.ctx.overrideDescriptor(this.cssStyleProto, 'cssText', {
|
||||
get: (target, that) => {
|
||||
const event = new _hook_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ value: target.call(that) }, target, that);
|
||||
this.emit('getCssText', event);
|
||||
|
||||
if (event.intercepted) return event.returnValue;
|
||||
return event.data.value;
|
||||
},
|
||||
set: (target, that, [ val ]) => {
|
||||
const event = new _hook_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ value: val }, target, that);
|
||||
this.emit('setCssText', event);
|
||||
|
||||
if (event.intercepted) return event.returnValue;
|
||||
return event.target.call(event.that, event.data.value);
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StyleApi);
|
||||
|
@ -39020,6 +39069,7 @@ class Ultraviolet {
|
|||
this.meta.origin ||= '';
|
||||
this.bundleScript = options.bundleScript || '/uv.bundle.js';
|
||||
this.handlerScript = options.handlerScript || '/uv.handler.js';
|
||||
this.configScript = options.handlerScript || '/uv.config.js';
|
||||
this.meta.url ||= this.meta.base || '';
|
||||
this.codec = Ultraviolet.codec;
|
||||
this.html = new _html_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue