Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught DOMException: An attempt was made to break through the security policy of the user agent. #354

Open
hasanrazahabi opened this issue Nov 14, 2023 · 18 comments

Comments

@hasanrazahabi
Copy link

I am getting this issue anyone other has such kind of issue please let me know how to fix it.

@wty302857194
Copy link

Have you solved it yet?

@hasanrazahabi
Copy link
Author

Not yet still looking to find it

@abdellatif-147
Copy link

Has anyone solved this problem ?

@Lixus
Copy link

Lixus commented Nov 22, 2023

I get the same error, and did not find any info on it.

1 similar comment
@liugezhou
Copy link

I get the same error, and did not find any info on it.

@rllovetindicator
Copy link

Got same error, and did not find any info on it.

@edencorbin
Copy link

Same error no info on it.

@wadguk
Copy link

wadguk commented Feb 1, 2024

same here

@valenIndovino
Copy link

same here. thanks.

@FADL285
Copy link

FADL285 commented Feb 28, 2024

Has anyone found a solution to this problem?

@AvramovSV
Copy link

AvramovSV commented Mar 12, 2024

Same problem

@Qwoxa
Copy link

Qwoxa commented Mar 12, 2024

A possible workaround

Setting Up a Reference and Tracking the "Open" Event for ShareNetwork

First, you need to create a ref for the ShareNetwork component and set up an event listener to track when it opens. Also, you need to assign an event listener to the open event, which triggers the runWorkaround function (will be described in the next paragraph):

const shareNetworkRef = ref(null);

<template>
  <ShareNetwork ref="shareNetworkRef" @open="runWorkaround" />
</template>

Implementing the Workaround Function

Due to security restrictions, the popupWindow object cannot be accessed . To address this, we've implemented a workaround that involves clearing this variable and stopping the interval, which checks if the popup has been closed:

function runWorkaround(index: number): void {
  if (shareNetworkRef.value === null) return;

  clearInterval(shareNetworkRef.value.popupInterval);
  shareNetworkRef.value.popupWindow = undefined;
}

Important Consideration

By applying this workaround, you will lose the ability to monitor the 'close' event of the ShareNetwork component. It's important to note that in the current implementation, tracking the 'close' event is not functioning correctly either. Therefore, although this workaround has a limitation, it addresses the existing issue by providing a temporary solution.

@Haunth
Copy link

Haunth commented Mar 12, 2024

A possible workaround

Setting Up a Reference and Tracking the "Open" Event for ShareNetwork

First, you need to create a ref for the ShareNetwork component and set up an event listener to track when it opens. Also, you need to assign an event listener to the open event, which triggers the runWorkaround function (will be described in the next paragraph):

const shareNetworkRef = ref(null);

<template>
  <ShareNetwork ref="shareNetworkRef" @open="runWorkaround" />
</template>

Implementing the Workaround Function

Due to security restrictions, the popupWindow object cannot be accessed . To address this, we've implemented a workaround that involves clearing this variable and stopping the interval, which checks if the popup has been closed:

function runWorkaround(index: number): void {
  if (shareNetworkRef.value === null) return;

  clearInterval(shareNetworkRef.popupInterval);
  shareNetworkRef.popupWindow = undefined;
}

Important Consideration

By applying this workaround, you will lose the ability to monitor the 'close' event of the ShareNetwork component. It's important to note that in the current implementation, tracking the 'close' event is not functioning correctly either. Therefore, although this workaround has a limitation, it addresses the existing issue by providing a temporary solution.

Thank Your so much. I fixed this problem. Buts you need change your function like this:
`
function runWorkaround(index: number): void {
if (shareNetworkRef.value === null) return;

clearInterval(shareNetworkRef.value.popupInterval);
shareNetworkRef.value.popupWindow = undefined;
}
`
Because shareNetworkRef is ref

@Qwoxa
Copy link

Qwoxa commented Mar 12, 2024

A possible workaround

Setting Up a Reference and Tracking the "Open" Event for ShareNetwork

First, you need to create a ref for the ShareNetwork component and set up an event listener to track when it opens. Also, you need to assign an event listener to the open event, which triggers the runWorkaround function (will be described in the next paragraph):

const shareNetworkRef = ref(null);

<template>
  <ShareNetwork ref="shareNetworkRef" @open="runWorkaround" />
</template>

Implementing the Workaround Function

Due to security restrictions, the popupWindow object cannot be accessed . To address this, we've implemented a workaround that involves clearing this variable and stopping the interval, which checks if the popup has been closed:

function runWorkaround(index: number): void {
  if (shareNetworkRef.value === null) return;

  clearInterval(shareNetworkRef.popupInterval);
  shareNetworkRef.popupWindow = undefined;
}

Important Consideration

By applying this workaround, you will lose the ability to monitor the 'close' event of the ShareNetwork component. It's important to note that in the current implementation, tracking the 'close' event is not functioning correctly either. Therefore, although this workaround has a limitation, it addresses the existing issue by providing a temporary solution.

Thank Your so much. I fixed this problem. Buts you need change your function like this: ` function runWorkaround(index: number): void { if (shareNetworkRef.value === null) return;

clearInterval(shareNetworkRef.value.popupInterval); shareNetworkRef.value.popupWindow = undefined; } ` Because shareNetworkRef is ref

Oh, missed it. Thank you, fixed.

@Darshan0092
Copy link

Darshan0092 commented Apr 1, 2024

I am using Javascript and Vue 3 Version:-
This is Working For me.

index is not required
const shareNetworkRef = ref(null);

const runWorkaround = (index) => {
if (shareNetworkRef.value === null) return;

clearInterval(shareNetworkRef.value.popupInterval);
shareNetworkRef.value.popupWindow = undefined;
}

@suangencong
Copy link

A possible workaround

Setting Up a Reference and Tracking the "Open" Event for ShareNetwork

First, you need to create a ref for the ShareNetwork component and set up an event listener to track when it opens. Also, you need to assign an event listener to the open event, which triggers the runWorkaround function (will be described in the next paragraph):

const shareNetworkRef = ref(null);

<template>
  <ShareNetwork ref="shareNetworkRef" @open="runWorkaround" />
</template>

Implementing the Workaround Function

Due to security restrictions, the popupWindow object cannot be accessed . To address this, we've implemented a workaround that involves clearing this variable and stopping the interval, which checks if the popup has been closed:

function runWorkaround(index: number): void {
  if (shareNetworkRef.value === null) return;

  clearInterval(shareNetworkRef.popupInterval);
  shareNetworkRef.popupWindow = undefined;
}

Important Consideration

By applying this workaround, you will lose the ability to monitor the 'close' event of the ShareNetwork component. It's important to note that in the current implementation, tracking the 'close' event is not functioning correctly either. Therefore, although this workaround has a limitation, it addresses the existing issue by providing a temporary solution.

Thank Your so much. I fixed this problem. Buts you need change your function like this: function runWorkaround(index: number): void { if (shareNetworkRef.value === null) return; clearInterval(shareNetworkRef.value.popupInterval); shareNetworkRef.value.popupWindow = undefined; } Because shareNetworkRef is ref

Oh, missed it. Thank you, fixed.

VUE2 NUXT vue-social-sharing . Error : Uncaught DOMException: An attempt was made to break through the security policy of the user agent. May I how to handle this issue? Thank you for your support.

Uncaught DOMException: An attempt was made to break through the security policy of the user agent.
at ie (https://www.XXXX.com/_nuxt/a1925a6.js:2:12130)
at Object.get [as popupWindow] (https://www.XXXX.com/_nuxt/a1925a6.js:2:10906)
at vo.get [as popupWindow] (https://www.XXXX.com/_nuxt/a1925a6.js:2:40591)
at https://www.XXXX.com/_nuxt/dadf402.js:2:64148

@craigh411
Copy link

craigh411 commented Apr 23, 2024

A possible workaround

Setting Up a Reference and Tracking the "Open" Event for ShareNetwork

First, you need to create a ref for the ShareNetwork component and set up an event listener to track when it opens. Also, you need to assign an event listener to the open event, which triggers the runWorkaround function (will be described in the next paragraph):

const shareNetworkRef = ref(null);

<template>
  <ShareNetwork ref="shareNetworkRef" @open="runWorkaround" />
</template>

Implementing the Workaround Function

Due to security restrictions, the popupWindow object cannot be accessed . To address this, we've implemented a workaround that involves clearing this variable and stopping the interval, which checks if the popup has been closed:

function runWorkaround(index: number): void {
  if (shareNetworkRef.value === null) return;

  clearInterval(shareNetworkRef.value.popupInterval);
  shareNetworkRef.value.popupWindow = undefined;
}

Important Consideration

By applying this workaround, you will lose the ability to monitor the 'close' event of the ShareNetwork component. It's important to note that in the current implementation, tracking the 'close' event is not functioning correctly either. Therefore, although this workaround has a limitation, it addresses the existing issue by providing a temporary solution.

For anybody still using the Option API, you can do the same thing like this:

methods: {
  runWorkaround() {
    if (this.$refs.shareNetworkRef === null) return;

      clearInterval(this.$refs.shareNetworkRef.popupInterval);
      this.$refs.shareNetworkRef.popupWindow = undefined;
  }
},

@nayan-7span
Copy link

nayan-7span commented Jul 2, 2024

I am using Javascript and Vue 3 Version:- This is Working For me.

index is not required const shareNetworkRef = ref(null);

const runWorkaround = (index) => { if (shareNetworkRef.value === null) return;

clearInterval(shareNetworkRef.value.popupInterval); shareNetworkRef.value.popupWindow = undefined; }

Index is needed when we are working with multiple sharing. I resolved the issue with.

  console.log("shared network ref", shareNetworkRef.value[index]);
  if (shareNetworkRef.value[index] === null) return;

  clearInterval(shareNetworkRef.value[index].popupInterval);

  shareNetworkRef.value[index].popupWindow = undefined;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests