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

Failure Detection Handler #76

Open
amcdnl opened this issue Dec 1, 2020 · 4 comments
Open

Failure Detection Handler #76

amcdnl opened this issue Dec 1, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@amcdnl
Copy link

amcdnl commented Dec 1, 2020

Problem

If a user is using a ad blocker, sometimes it will not start up fullstory. I would like the ability to catch if the error occurs and handle it.

Proposal

You could do something like make Fullstory.init return a Promise and error if it fails, so you could do:

(async () => {
   try {
      await Fullstory.init({ orgId: 'asdf' });
   } catch (e) {
        alert('Kindly turn that ad blocker off');
   }
}();
@patrick-fs
Copy link
Member

Hey Austin! Thanks for proposing this, sorry for the delayed reply. Let me circle back with some other folks on my team to review.

@amcdnl
Copy link
Author

amcdnl commented Dec 8, 2020

I ended up using this: https://www.npmjs.com/package/use-ad-block-detection - would be nice to have this built in though.

@patrick-fs patrick-fs added the enhancement New feature or request label Dec 11, 2020
@van-fs
Copy link
Member

van-fs commented Dec 11, 2020

The way these ad blockers typically work is blocking the URL pattern to the recording script fs.js. It would be useful to have even a naive timeout on whether FS is ever loaded into the window. Another use case is content-security-policy that could also block fs.js. Thanks for bringing it up.

@amcdnl
Copy link
Author

amcdnl commented Dec 13, 2020

@van-fs - Yup - the ad block hook I demonstrated above just tries to request the script and when it fails it handles the exception. This of course causes duplicate calls ( though cached ) so it would be grat to handle this in the lib itself.

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

No branches or pull requests

3 participants