Coder Social home page Coder Social logo

Comments (17)

Qwoxa avatar Qwoxa commented on June 2, 2024 2

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.

from vue-social-sharing.

Haunth avatar Haunth commented on June 2, 2024 1

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

from vue-social-sharing.

wty302857194 avatar wty302857194 commented on June 2, 2024

Have you solved it yet?

from vue-social-sharing.

hasanrazahabi avatar hasanrazahabi commented on June 2, 2024

Not yet still looking to find it

from vue-social-sharing.

abdellatif-147 avatar abdellatif-147 commented on June 2, 2024

Has anyone solved this problem ?

from vue-social-sharing.

Lixus avatar Lixus commented on June 2, 2024

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

from vue-social-sharing.

liugezhou avatar liugezhou commented on June 2, 2024

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

from vue-social-sharing.

rllovetindicator avatar rllovetindicator commented on June 2, 2024

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

from vue-social-sharing.

edencorbin avatar edencorbin commented on June 2, 2024

Same error no info on it.

from vue-social-sharing.

wadguk avatar wadguk commented on June 2, 2024

same here

from vue-social-sharing.

valenIndovino avatar valenIndovino commented on June 2, 2024

same here. thanks.

from vue-social-sharing.

FADL285 avatar FADL285 commented on June 2, 2024

Has anyone found a solution to this problem?

from vue-social-sharing.

AvramovSV avatar AvramovSV commented on June 2, 2024

Same problem

from vue-social-sharing.

Qwoxa avatar Qwoxa commented on June 2, 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.

from vue-social-sharing.

Darshan0092 avatar Darshan0092 commented on June 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;
}

from vue-social-sharing.

suangencong avatar suangencong commented on June 2, 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.

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

from vue-social-sharing.

craigh411 avatar craigh411 commented on June 2, 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;
  }
},

from vue-social-sharing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.