npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-detect-tracking-protection

v3.3.0

Published

Checks to see if the browser has tracking protection.

Downloads

5

Readme

ember-detect-tracking-protection

Addon made to help detect Firefox's tracking protection feature which is based off of Disconnect. This addon may also be used to detect similar featured plugins that a user may install to their browser like uBlock Origin.

Installation

ember install ember-detect-tracking-protection

What is Tracking Protection?

Tracking can be described as the collection of a person's browsing data across a multitude of websites. Tracking Protection prevents services from utilizing tracking usually by intercepting the request and blocking it. Firefox and browser extensions such as uBlockOrigin utilize Tracking Protection but in different ways.

Firefox uses a list provided from Disconnect to decide what domains/services they intercept. Currently by default, Firefox does not turn on Tracking Protection for normal browsing but, in it's Private Browsing mode it is active. This is an option in the browser settings that users can have Tracking Protection at all times.

Ads are gone, why should I care?

Tracking Protection goes beyond the blocking of ads. For instance, those who use a tag manager such as Google Tag Manager, which can be used for the addition of JavaScript functionality to your application or website, GTM is blocked as well.

This is why this addon exists. To provide a second course of action when a service that you expect to be present, is not for some users due to Tracking Protection, extensions, or similar interceptors.

Usage

Basic Component Setup using Mixin

import Component from '@ember/component';
import Detect from 'ember-detect-tracking-protection/mixins/detect';

export default Component.extend(Detect, {
  detectResolved(hasTrackingProtection) {
    --Do Something--
  }
});
  • detectResolved() is called once when the component is initialized or when the mixin resolves the answer
  • detectResolved() passes a boolean parameter if the browser has tracking protection

Using the Service

detect: service('detect-tp')

There is a detect-tp service that you can tap into. Here are the following methods you can utilize off of it.

  • hasTrackingProtection() - returns a boolean if the browser the user is using has Tracking Protection. It will return null if the detection has yet to be resolved.
  • isDoNotTrack() - Returns a boolean if the user's browser doNotTrack Setting for the browser. This does not mean it has tracking protection on, but used as a signal.
  • ping(url[, noCache=true]) - Pass a custom resource url to see if the browser is blocking it. It will return a promise and resolve if the browser loads it, and rejects when it will not load.

There is a few public variables as well

  • isBlocked - Returns a Boolean if Tracking Protection is enabled on a browser. default is false while it resolves
  • hasChecked - Returns a Boolean if the service has resolved or not the static, standard asset.

Other Utilities

  • isDoNotTrack - Direct import of the above isDoNotTrack (const) in case you do not want to load in the service
import { isDoNotTrack } from 'ember-detect-tracking-protection/utilities/detect';

Other Resources

Contributing

Installation

  • git clone [email protected]:joshsearles/ember-detect-tracking-protection.git
  • cd ember-detect-tracking-protection
  • npm install

Linting

  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.