From 2d2452eb83a23f5dc8d87f8480184ad7b391f7ff Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Thu, 12 Dec 2024 10:12:45 +0100 Subject: [PATCH] fix: do not check for browser extension in mobile app (#57470) Co-authored-by: Oliver Eyton-Williams --- .../5dc174fcf86c76b9248c6eb2.md | 8 +++++--- .../workshop-cat-photo-app/5dc174fcf86c76b9248c6eb2.md | 8 +++++--- tools/client-plugins/browser-scripts/frame-runner.ts | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md index d474d05ef8d..83abb16cfdd 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md @@ -49,9 +49,11 @@ assert(document.querySelector('h1').innerText.toLowerCase() === 'catphotoapp'); You appear to be using a browser extension that is modifying the page. Be sure to turn off all browser extensions. ```js -assert.isAtMost(document.querySelectorAll('script').length, 2); -assert.equal(document.querySelectorAll('style').length, 1); -assert.equal(document.querySelectorAll('link').length, 0); +if(__checkForBrowserExtensions){ + assert.isAtMost(document.querySelectorAll('script').length, 2); + assert.equal(document.querySelectorAll('style').length, 1); + assert.equal(document.querySelectorAll('link').length, 0); +} ``` # --seed-- diff --git a/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5dc174fcf86c76b9248c6eb2.md b/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5dc174fcf86c76b9248c6eb2.md index a6f7e1c1fb2..654d0bc700a 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5dc174fcf86c76b9248c6eb2.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-cat-photo-app/5dc174fcf86c76b9248c6eb2.md @@ -50,9 +50,11 @@ assert.equal(document.querySelector('h1').innerText.toLowerCase(), 'catphotoapp' You appear to be using a browser extension that is modifying the page. Be sure to turn off all browser extensions. ```js -assert.isAtMost(document.querySelectorAll('script').length, 2); -assert.equal(document.querySelectorAll('style').length, 1); -assert.equal(document.querySelectorAll('link').length, 0); +if(__checkForBrowserExtensions){ + assert.isAtMost(document.querySelectorAll('script').length, 2); + assert.equal(document.querySelectorAll('style').length, 1); + assert.equal(document.querySelectorAll('link').length, 0); +} ``` # --seed-- diff --git a/tools/client-plugins/browser-scripts/frame-runner.ts b/tools/client-plugins/browser-scripts/frame-runner.ts index cd91668a655..e1f68df1846 100644 --- a/tools/client-plugins/browser-scripts/frame-runner.ts +++ b/tools/client-plugins/browser-scripts/frame-runner.ts @@ -61,6 +61,7 @@ async function initTestFrame(e: InitTestFrameArg = { code: {} }) { const { default: chai } = await import(/* webpackChunkName: "chai" */ 'chai'); const assert = chai.assert; const __helpers = helpers; + const __checkForBrowserExtensions = true; /* eslint-enable @typescript-eslint/no-unused-vars */ let Enzyme;