GithubHelp home page GithubHelp logo

Comments (1)

MSNev avatar MSNev commented on June 10, 2024 4

Hello, as a generic library we will not be removing the backward compatibility support for "hooking" the unload event.

However,
we have a really badly documented (like barely) configuration option that we introduced in v3.0.3 which allows you to tell use which events you "don't" want us to hook. So you can avoid the "warning" by simply adding the configuration option

/**
* [Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload
* event hooked, if you list all or the runtime environment only supports a listed "disabled" event it will still be hooked, if required by the SDK.
* Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide"
*/
disablePageUnloadEvents?: string[];

disablePageUnloadEvents: [ "unload" ],

And once the event is no longer present (which we will still attempt to hook it), it just won't be hooked.

I'm going to mark this issue as a documentation issue as we REALLY need to document this better.
Some readme level documentation exists for the @microsoft/1ds-core-js package which is now co-located in this repo and this is the same configuraiton option as the 1ds-core-js is built on-top of applicationinsights-core-js
https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/1ds-core-js#iextendedconfiguration

from applicationinsights-js.

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.