diff --git a/src/client.js b/src/client.js
index a48a71c..f6409bf 100644
--- a/src/client.js
+++ b/src/client.js
@@ -119,6 +119,7 @@ persistStore(store, {}, () => {
(function load() {
const onLoad = () => {
+ window.name = 'main';
renderApp(document.getElementById('app'), store);
const onKeyPress = createKeyPressHandler(store);
diff --git a/src/components/MdLink.jsx b/src/components/MdLink.jsx
index bc26e0f..f38dee8 100644
--- a/src/components/MdLink.jsx
+++ b/src/components/MdLink.jsx
@@ -9,6 +9,7 @@ import { HiArrowsExpand, HiStop } from 'react-icons/hi';
import { getLinkDesc } from '../core/utils';
import EMBEDS from './embeds';
+import { isPopUp } from './windows/popUpAvailable';
const titleAllowed = [
'odysee',
@@ -27,8 +28,13 @@ const MdLink = ({ href, title, refEmbed }) => {
// treat pixelplanet links seperately
if (desc === window.location.hostname && href.includes('/#')) {
const coords = href.substring(href.indexOf('/#') + 1);
+ if (isPopUp() && window.opener && !window.opener.closed) {
+ return (
+ {title || coords}
+ );
+ }
return (
- {title || coords}
+ {title || coords}
);
}
diff --git a/src/store/middleware/parent.js b/src/store/middleware/parent.js
index 3b52725..58e1d74 100644
--- a/src/store/middleware/parent.js
+++ b/src/store/middleware/parent.js
@@ -9,7 +9,7 @@ import { load, unload } from '../actions';
const { origin } = window.location;
window.addEventListener('beforeunload', () => {
- if (window.opener && !window.closed) {
+ if (window.opener && !window.opener.closed) {
window.opener.postMessage(unload(), origin);
}
});