pdf_editor_aleon35_react_plugin
Advanced tools
Comparing version 1.0.20 to 1.0.22
@@ -11,3 +11,3 @@ "use strict"; | ||
var useCreateIframeAndLoadViewer = function useCreateIframeAndLoadViewer(_ref) { | ||
var domWindow = _ref.domWindow, | ||
var domWindow = _ref.window, | ||
file = _ref.file, | ||
@@ -60,3 +60,3 @@ fileName = _ref.fileName, | ||
// Set up an event listener to listen for a response from the iframe | ||
window.addEventListener('message', function (event) { | ||
window.parent.addEventListener('message', function (event) { | ||
if (event.data.type === 'file-received' && event.data.success) { | ||
@@ -81,9 +81,8 @@ // If the message was received successfully, clear the interval | ||
(0, _react.useEffect)(function () { | ||
domWindow.addEventListener('message', handleIframeLoaded); | ||
window.parent.addEventListener('message', handleIframeLoaded); | ||
return function () { | ||
return domWindow.removeEventListener('message', handleIframeLoaded); | ||
return window.parent.removeEventListener('message', handleIframeLoaded); | ||
}; | ||
}, []); | ||
var handleVisibilityChange = function handleVisibilityChange() { | ||
console.log(iframeLoadedSuccessfully.current, 'iframeLoadedSuccessfully.current'); | ||
if (!document.hidden && !iframeLoadedSuccessfully.current) { | ||
@@ -90,0 +89,0 @@ var iframe = document.getElementById('webviewer-1'); |
{ | ||
"name": "pdf_editor_aleon35_react_plugin", | ||
"version": "1.0.20", | ||
"version": "1.0.22", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,3 +5,3 @@ import { useEffect, useRef } from 'react'; | ||
export const useCreateIframeAndLoadViewer = ({ | ||
domWindow, | ||
window: domWindow, | ||
file, | ||
@@ -54,3 +54,3 @@ fileName, | ||
// Set up an event listener to listen for a response from the iframe | ||
window.addEventListener('message', function(event) { | ||
window.parent.addEventListener('message', function(event) { | ||
if (event.data.type === 'file-received' && event.data.success) { | ||
@@ -78,8 +78,7 @@ // If the message was received successfully, clear the interval | ||
useEffect(() => { | ||
domWindow.addEventListener('message', handleIframeLoaded); | ||
return () => domWindow.removeEventListener('message', handleIframeLoaded); | ||
window.parent.addEventListener('message', handleIframeLoaded); | ||
return () => window.parent.removeEventListener('message', handleIframeLoaded); | ||
}, []); | ||
const handleVisibilityChange = () => { | ||
console.log(iframeLoadedSuccessfully.current, 'iframeLoadedSuccessfully.current') | ||
if (!document.hidden && !iframeLoadedSuccessfully.current) { | ||
@@ -86,0 +85,0 @@ const iframe = document.getElementById('webviewer-1'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
4546501
128
1
12
234
13