20c2b75b01
* refactor: Move Plugins Out and Consolidate with Multisrc * feat: Overhaul Playground UI * feat: Add Filters to New UI * feat: Persist Selected Plugin * feat: Add Direct Parse Novel/Chapter Options and Feedback Toasts [skip ci] * feat: UX Improvements * chore: Update Plugin Path in Publish Workflow * fix: Add Backward Compatibility * chore: Update Plugin Publishing Script
34 lines
823 B
TypeScript
34 lines
823 B
TypeScript
import 'cheerio';
|
|
import 'htmlparser2';
|
|
import 'dayjs';
|
|
import 'protobufjs';
|
|
import './index.css';
|
|
|
|
import React from 'react';
|
|
import ReactDOM from 'react-dom/client';
|
|
|
|
import App from './App';
|
|
|
|
const { fetch: originalFetch } = window;
|
|
|
|
window.fetch = async (...args) => {
|
|
const [resource, config] = args;
|
|
if (resource.toString().includes('localhost'))
|
|
return await originalFetch(resource, config);
|
|
const _res = await originalFetch('http://localhost:3000/' + resource, {
|
|
...config,
|
|
credentials: 'include',
|
|
mode: 'cors',
|
|
});
|
|
Object.defineProperty(_res, 'url', {
|
|
value: _res.url.includes('localhost') ? resource.toString() : _res.url,
|
|
});
|
|
return _res;
|
|
};
|
|
|
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
|
<React.StrictMode>
|
|
<App />
|
|
</React.StrictMode>,
|
|
);
|