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.

Bug: uBlock Origin breaks certain javascript challenges

See original GitHub issue

Affected page Various challenges in “Basic javascript” lessons. First fully-broken lesson I encountered: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/return-early-pattern-for-functions Previous lessons gave same error, but were passable without disabling uBlock. Your code Copy and paste the code from the editor that you used in between the back-ticks below: Have uBlock Origin addon active and try correct solution for https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/return-early-pattern-for-functions Interestingly, I tried replicating the issue by re-enabling uBlock and trying the code again, and it passed subsequent times with uBlock enabled.

// Setup
function abTest(a, b) {
  // Only change code below this line

if (a < 0 || b < 0) {
  return undefined;
}

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

abTest(2,2);

Expected behavior Add a clear and concise description of what you expected to happen. Correct solution passes test.

Screenshots If applicable, add screenshots to help explain your problem. you can drag and drop, png, jpg, gif, etc. in this box. Top banner error message that said something along the lines of " Something went wrong, a report has been filed for this issue"

System (please complete the following information):

  • Device: [desktop]
  • OS: [e.g. Windows 10]
  • Browser: [Firefox, uBlock Origin addon]
  • Version: [e.g. 22]

Additional context Add any other context about the problem here. Yeah, it appears uBlock is breaking something with javascript. My understanding is uBlock utilizes different injection methods to heuristically sanitize ad scripts. However, re-enabling uBlock and running the test again with the same correct code passes the test.
Solution that has worked for me so far is just add freecodecamp.org to the allowlist.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
lasjorgcommented, May 8, 2021

We are basically reintroducing https://github.com/freeCodeCamp/freeCodeCamp/pull/38806 which as an aside originally also tried to deal with ad/script blockers.

Might it not be better to add the warning to the top of the RWD start page instead of the section blocks?

  1. It’s not just the Basic CSS section that has color challenges.

  2. I get that the camper is automatically taken from the last HTML challenge to the first CSS challenge (which uses colors). So having a warning on this challenge might be necessary. But again this might be avoided simpely by having a warning at the begining of the RWD section.

Here it is with a bootstrap alert. But it can also just be a simple paragraph (note in bold, or all of it in bold).

RWD-start-section-bootstrap-alert

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Bug: uBlock Origin breaks certain javascript challenges -
Various challenges in "Basic javascript" lessons. ... Previous lessons gave same error, but were passable without disabling uBlock. ... Interestingly, I tried ...
Read more >
How to Unblock a Web Page Element With uBlock Origin
To unblock any element, you need to open the uBlock Origin network logger, you can do this by clicking the uBlock Origin icon...
Read more >
526413 - uBlock Functions Inconsistently on YouTube - Monorail
When the bug was present, requests to youtube.com were not visible to extensions such as uBlock origin. With the bug being fixed, such...
Read more >
Has anyone else noticed uBlock Origin is stopping some sites ...
Are there any known problems with uBlock Origin that I should be aware ... If I enable uBO and disable javascript all websites...
Read more >
1232354 - uBlock Origin makes the loading of a long page ...
Version level or extension problems or Gecko problems that cause extensions not to work. Also home to INVALID bugs where a malfunctioning extension...
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