mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
commit
8ee7fcd283
@ -1,14 +1,5 @@
|
||||
import { window } from 'global';
|
||||
|
||||
if (window && window.parent !== window) {
|
||||
try {
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
} catch (error) {
|
||||
// The above line can throw if we do not have access to the parent frame -- i.e. cross origin
|
||||
}
|
||||
}
|
||||
|
||||
if (window) {
|
||||
window.STORYBOOK_ENV = 'react';
|
||||
}
|
||||
|
@ -1,14 +1,4 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
import { window } from 'global';
|
||||
|
||||
if (window.parent !== window) {
|
||||
try {
|
||||
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
||||
window.parent.__VUE_DEVTOOLS_CONTEXT__ = window.document;
|
||||
} catch (error) {
|
||||
// The above lines can throw if we do not have access to the parent frame -- i.e. cross origin
|
||||
}
|
||||
}
|
||||
|
||||
window.STORYBOOK_REACT_CLASSES = {};
|
||||
window.STORYBOOK_ENV = 'vue';
|
||||
|
@ -12,12 +12,11 @@
|
||||
/* globals window */
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
try {
|
||||
if (window.parent !== window) {
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (window.top !== window) {
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
}
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('unable to connect to parent frame for connecting dev tools');
|
||||
console.warn('unable to connect to top frame for connecting dev tools');
|
||||
}
|
||||
</script>
|
||||
|
@ -67,12 +67,13 @@
|
||||
/* globals window */
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
try {
|
||||
if (window.parent !== window) {
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (window.top !== window) {
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.top.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
||||
window.top.__VUE_DEVTOOLS_CONTEXT__ = window.document;
|
||||
}
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('unable to connect to parent frame for connecting dev tools');
|
||||
console.warn('unable to connect to top frame for connecting dev tools');
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user