@@ -5,12 +5,10 @@ import { HashRouter as Router } from 'react-router-dom'
|
||||
import App from './App'
|
||||
import {store} from './store/store';
|
||||
|
||||
import { allowMessages } from './utils/messagesApi'
|
||||
import './utils/messagesApi'
|
||||
|
||||
globalThis.Buffer = Buffer
|
||||
|
||||
allowMessages();
|
||||
|
||||
window.store = store;
|
||||
|
||||
BigInt.prototype.toJSON = function() {
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
export const allowMessages = () => {
|
||||
const domains = [
|
||||
"http://dev.kandrusyak.ru",
|
||||
]
|
||||
window.addEventListener("message", messageHandler, false);
|
||||
|
||||
function messageHandler(event) {
|
||||
if (!domains.includes(event.origin))
|
||||
return;
|
||||
const {action, key, value} = event.data
|
||||
if (action === 'save') {
|
||||
window.localStorage.setItem(key, JSON.stringify(value))
|
||||
}
|
||||
const domains = [
|
||||
"http://dev.kandrusyak.ru",
|
||||
]
|
||||
window.addEventListener("message", messageHandler, false);
|
||||
function messageHandler(event) {
|
||||
if (!domains.includes(event.origin))
|
||||
return;
|
||||
const { action, key, value } = event.data
|
||||
if (action === 'save'){
|
||||
window.localStorage.setItem(key, JSON.stringify(value))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user