modified: src/ui.js
This commit is contained in:
parent
9a71e71873
commit
fb38570227
1 changed files with 13 additions and 2 deletions
15
src/ui.js
15
src/ui.js
|
|
@ -1724,7 +1724,12 @@ export function openTranslateModal() {
|
|||
const baseUrl = window.location.origin + window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
|
||||
|
||||
let htmlWithBase;
|
||||
const scriptTag = '<script src="https://uncloseai.com/uncloseai.js" type="module"></script>';
|
||||
const scriptTag = `
|
||||
const scriptTag = `
|
||||
<script>
|
||||
window.UNCLOSEAI_SKIP_INIT = true;
|
||||
</script>
|
||||
<script src="https://uncloseai.com/uncloseai.js" type="module"></script>`;`;
|
||||
|
||||
if (translatedText.includes('<!DOCTYPE')) {
|
||||
// Already has DOCTYPE, just add base and script
|
||||
|
|
@ -1791,6 +1796,12 @@ export function openTranslateModal() {
|
|||
|
||||
// Initialize the system
|
||||
export function initializeSystem() {
|
||||
// Prevent duplicate initialization in popup windows
|
||||
if (window.UNCLOSEAI_SKIP_INIT === true) {
|
||||
console.log('uncloseai.js: Skipping initialization as requested by flag.');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('uncloseai.js: Initializing system');
|
||||
initializeChatInterface();
|
||||
|
||||
|
|
@ -1804,4 +1815,4 @@ export function initializeSystem() {
|
|||
|
||||
// Initialize class-based elements
|
||||
initializeUncloseaiElements();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue