mirror of
https://github.com/chinchang/web-maker.git
synced 2025-05-11 04:45:42 +02:00
build 3.6.2
This commit is contained in:
parent
9fa506d4c0
commit
2054da9968
@ -1,5 +1,6 @@
|
||||
window.addEventListener('message', e => {
|
||||
if (e.data && e.data.contents) {
|
||||
// Web app
|
||||
if (e.data && e.data.contents && e.data.contents.match(/<html/)) {
|
||||
const frame = document.querySelector('iframe');
|
||||
frame.src = frame.src;
|
||||
setTimeout(() => {
|
||||
@ -7,7 +8,8 @@ window.addEventListener('message', e => {
|
||||
frame.contentDocument.write(e.data.contents);
|
||||
frame.contentDocument.close();
|
||||
}, 10);
|
||||
} else {
|
||||
} else if (e.data && e.data.match(/preview\.html/)) {
|
||||
// Chrome extension
|
||||
document.querySelector('iframe').src = e.data;
|
||||
}
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user