Fixed css iframe rendering bug
All checks were successful
Automated Container Build / build-and-push (push) Successful in 39s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 39s
This commit is contained in:
parent
3e19cae267
commit
0dc80a2c43
1 changed files with 17 additions and 0 deletions
|
|
@ -101,6 +101,21 @@ export default function OnlyOfficeEditor({ file, type, onClose }: OnlyOfficeEdit
|
|||
|
||||
const docServerUrl = 'https://office.elijahkuntz.com/';
|
||||
|
||||
// Add a diagnostic check to ensure the browser can reach the OnlyOffice server
|
||||
useEffect(() => {
|
||||
if (!config) return;
|
||||
|
||||
// We try to fetch the api.js script to see if it's blocked by DNS/SSL/Brave Shields
|
||||
const scriptUrl = `${docServerUrl}web-apps/apps/api/documents/api.js`;
|
||||
fetch(scriptUrl, { mode: 'no-cors' })
|
||||
.then(() => {
|
||||
console.log("OnlyOffice API script is reachable.");
|
||||
})
|
||||
.catch((err) => {
|
||||
setLoadError(`Browser cannot reach ${scriptUrl}. This is usually caused by: 1) Missing DNS record for office.elijahkuntz.com, 2) Invalid SSL Certificate, or 3) Browser blocking the connection (Brave Shields). Please check your browser's Developer Console (F12) for the exact network error.`);
|
||||
});
|
||||
}, [config]);
|
||||
|
||||
const onDocumentReady = function (event: any) {
|
||||
console.log("Document is loaded");
|
||||
};
|
||||
|
|
@ -138,6 +153,8 @@ export default function OnlyOfficeEditor({ file, type, onClose }: OnlyOfficeEdit
|
|||
config={config}
|
||||
events_onDocumentReady={onDocumentReady}
|
||||
onLoadComponentError={onLoadComponentError}
|
||||
height="100%"
|
||||
width="100%"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue