question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extensions like uBlock are preventing the script from loading

See original GitHub issue

Good day,

We noticed that content-filtering extensions like uBlock are preventing the downloading of the analytics library.

Screen Shot 2021-10-22 at 8 26 33 AM

We are using @analytics/amplitude and I was hoping to utilize customScriptSrc to proxy the library through our domain, but in your code, it is doing a checksum verification, so I might need to fork it to remove that check, but before I do that…

Have anyone found a workaround to this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
DavidWellscommented, Oct 24, 2021

Updated the integrity check via @analytics/amplitude@0.1.2

let integrity
if (integritySha) {
   integrity = integritySha
} else if (!customScriptSrc) {
   // use default
   integrity = 'sha384-u0hlTAJ1tNefeBKwiBNwB4CkHZ1ck4ajx/pKmwWtc+IufKJiCQZ+WjJIi+7C6Ntm'
}
1reaction
stanyq4commented, Oct 24, 2021

@DavidWells Have you had a chance to test your fix?

I just tried passing a public S3 URL and integritySha, but getting:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'init').

Was quickly debugging locally, but the execution doesn’t even go into:

      // Initialize amplitude js
      (function(e, t) {

Based on this line:

const integrity = integritySha || 'sha384-u0hlTAJ1tNefeBKwiBNwB4CkHZ1ck4ajx/pKmwWtc+IufKJiCQZ+WjJIi+7C6Ntm'

integritySha always has to be provided, can we disable it? so if it’s not provided - we just don’t perform the integrity check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable "uBlock Origin has prevented the following ...
Open the site which has popups · Click the uBlock extension icon · Select icon which looks like two overlapping squares "Click to...
Read more >
Script blocked by uBlock origin prevents submitting answers
The javascript is prevented from loading completly, which causes javascript errors, which causes the button to not respond to actions. According ...
Read more >
Block Unreachable Scripts - Firefox Add-ons
Prevent unreachable servers from stalling websites by disabling their scripts if they previously could not load.
Read more >
These 6 browser extensions will protect your privacy online
Ad blockers stop them in their tracks by blocking ads from loading, but also the tracking code that comes with it. uBlock Origin...
Read more >
uBlock Origin gets option to block all JavaScript execution by ...
What this means is that the ad blocker will skip the execution of any JavaScript files on a page, and only load the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found