mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-22 00:45:15 +08:00
14 lines
454 B
JavaScript
14 lines
454 B
JavaScript
/* eslint-disable no-undef */
|
|
/* eslint-disable no-underscore-dangle */
|
|
|
|
const ContextifyModule = internalBinding('ContextifyModule');
|
|
|
|
global.dynamicLoad = (path, encode, cb) => {
|
|
let requestPath = path || '';
|
|
const isSchema = ['https://', 'http://', '//'].some(schema => requestPath.indexOf(schema) === 0);
|
|
if (!isSchema) {
|
|
requestPath = global.__HIPPYCURDIR__ + path;
|
|
}
|
|
ContextifyModule.LoadUntrustedContent(requestPath, encode, cb);
|
|
};
|