@cocreate/utils
Advanced tools
Comparing version 1.17.20 to 1.17.21
@@ -0,1 +1,8 @@ | ||
## [1.17.21](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.17.20...v1.17.21) (2023-01-27) | ||
### Bug Fixes | ||
* try to access window.top if fails continue ([c2bd8e6](https://github.com/CoCreate-app/CoCreate-utils/commit/c2bd8e6275ebb6450ffdac7a7d40ffd7837a87bc)) | ||
## [1.17.20](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.17.19...v1.17.20) (2023-01-10) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@cocreate/utils", | ||
"version": "1.17.20", | ||
"version": "1.17.21", | ||
"description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.", | ||
@@ -63,4 +63,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@cocreate/docs": "^1.5.6" | ||
"@cocreate/docs": "^1.5.7" | ||
} | ||
} |
@@ -18,17 +18,24 @@ (function (root, factory) { | ||
}); | ||
let frameDocuments = window.top.frameDocuments; | ||
if (!frameDocuments){ | ||
window.top.frameDocuments = new Map(); | ||
frameDocuments = window.top.frameDocuments; | ||
} | ||
let frames = document.querySelectorAll('iframe'); | ||
for (let frame of frames){ | ||
let frameDocument = frame.contentDocument; | ||
if (!frameDocuments.has(frameDocument)){ | ||
frameDocuments.set(frameDocument, '') | ||
frameDocument.addEventListener('click', e => { | ||
frameDocument.clickedElement = e.target; | ||
}); | ||
try { | ||
let frameDocuments = window.top.frameDocuments; | ||
if (!frameDocuments){ | ||
window.top.frameDocuments = new Map(); | ||
frameDocuments = window.top.frameDocuments; | ||
} | ||
} | ||
let frames = document.querySelectorAll('iframe'); | ||
for (let frame of frames){ | ||
let frameDocument = frame.contentDocument; | ||
if (!frameDocuments.has(frameDocument)){ | ||
frameDocuments.set(frameDocument, '') | ||
frameDocument.addEventListener('click', e => { | ||
frameDocument.clickedElement = e.target; | ||
}); | ||
} | ||
} | ||
} catch (e) { | ||
console.log('cross-origin failed') | ||
} | ||
} | ||
@@ -35,0 +42,0 @@ |
109610
1109
Updated@cocreate/docs@^1.5.7