Add AnyClip integration tools and extracted source code
- Add authentication scripts with SubtleCrypto password encryption - Add sourcemap extraction pipeline (update-urls, download-sourcemaps, extract-sources) - Add Playwright API interception script for monetization endpoints - Document two-step auth flow with JWT tokens and dual cookies - Move extracted source from root to anyclip/ directory - Add project configuration (.env.example, .gitignore, CLAUDE.md)
This commit is contained in:
77
anyclip/webpack/runtime/css-loading.js
Normal file
77
anyclip/webpack/runtime/css-loading.js
Normal file
@@ -0,0 +1,77 @@
|
||||
var createStylesheet = (chunkId, fullhref, resolve, reject) => {
|
||||
var linkTag = document.createElement("link");
|
||||
|
||||
linkTag.rel = "stylesheet";
|
||||
linkTag.type = "text/css";
|
||||
var onLinkComplete = (event) => {
|
||||
// avoid mem leaks.
|
||||
linkTag.onerror = linkTag.onload = null;
|
||||
if (event.type === 'load') {
|
||||
resolve();
|
||||
} else {
|
||||
var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
||||
var realHref = event && event.target && event.target.href || fullhref;
|
||||
var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + realHref + ")");
|
||||
err.code = "CSS_CHUNK_LOAD_FAILED";
|
||||
err.type = errorType;
|
||||
err.request = realHref;
|
||||
linkTag.parentNode.removeChild(linkTag)
|
||||
reject(err);
|
||||
}
|
||||
}
|
||||
linkTag.onerror = linkTag.onload = onLinkComplete;
|
||||
linkTag.href = fullhref;
|
||||
|
||||
(function(linkTag) {
|
||||
if (typeof _N_E_STYLE_LOAD === 'function') {
|
||||
const { href, onload, onerror } = linkTag;
|
||||
_N_E_STYLE_LOAD(href.indexOf(window.location.origin) === 0 ? new URL(href).pathname : href).then(()=>onload == null ? void 0 : onload.call(linkTag, {
|
||||
type: 'load'
|
||||
}), ()=>onerror == null ? void 0 : onerror.call(linkTag, {}));
|
||||
} else {
|
||||
document.head.appendChild(linkTag);
|
||||
}
|
||||
})(linkTag)
|
||||
return linkTag;
|
||||
};
|
||||
var findStylesheet = (href, fullhref) => {
|
||||
var existingLinkTags = document.getElementsByTagName("link");
|
||||
for(var i = 0; i < existingLinkTags.length; i++) {
|
||||
var tag = existingLinkTags[i];
|
||||
var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href");
|
||||
if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag;
|
||||
}
|
||||
var existingStyleTags = document.getElementsByTagName("style");
|
||||
for(var i = 0; i < existingStyleTags.length; i++) {
|
||||
var tag = existingStyleTags[i];
|
||||
var dataHref = tag.getAttribute("data-href");
|
||||
if(dataHref === href || dataHref === fullhref) return tag;
|
||||
}
|
||||
};
|
||||
var loadStylesheet = (chunkId) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
var href = __webpack_require__.miniCssF(chunkId);
|
||||
var fullhref = __webpack_require__.p + href;
|
||||
if(findStylesheet(href, fullhref)) return resolve();
|
||||
createStylesheet(chunkId, fullhref, resolve, reject);
|
||||
});
|
||||
}
|
||||
// object to store loaded CSS chunks
|
||||
var installedCssChunks = {
|
||||
8068: 0
|
||||
};
|
||||
|
||||
__webpack_require__.f.miniCss = (chunkId, promises) => {
|
||||
var cssChunks = {"476":1,"1231":1,"2439":1,"3189":1,"3210":1,"3942":1,"4835":1,"4876":1,"4996":1,"5557":1,"5865":1,"6557":1,"6666":1,"8083":1,"9636":1,"9837":1};
|
||||
if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
||||
else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
||||
promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {
|
||||
installedCssChunks[chunkId] = 0;
|
||||
}, (e) => {
|
||||
delete installedCssChunks[chunkId];
|
||||
throw e;
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
// no hmr
|
||||
Reference in New Issue
Block a user