Closed Bug 1723150 Opened 4 years ago Closed 4 years ago

medium.com breaks with the Optimizely ETP shim

Categories

(Core :: Privacy: Anti-Tracking, defect)

defect

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox90 --- unaffected
firefox91 --- unaffected
firefox92 --- fixed

People

(Reporter: u608768, Assigned: u608768)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

STR

  1. Set ETP to strict.
  2. Visit https://medium.com.
  3. Page content disappears after loading.

Console has "TypeError: can't access property "length", window.optimizely.get(...).getActiveExperimentIds() is undefined"

Something like

diff --git a/browser/extensions/webcompat/shims/optimizely.js b/browser/extensions/webcompat/shims/optimizely.js
--- a/browser/extensions/webcompat/shims/optimizely.js
+++ b/browser/extensions/webcompat/shims/optimizely.js
@@ -38,7 +38,7 @@ if (!window.optimizely?.state) {
 
   const state = {
     getActivationId() {},
-    getActiveExperimentIds() {},
+    getActiveExperimentIds() { return []; },
     getCampaignStateLists() {},
     getCampaignStates() {},
     getDecisionObject() {},

fixes this.

It runs optimzely.get("state").getActiveExperimentIds().length, which blows up
when we don't return anything.

Assignee: nobody → kmadan
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 1714431

Thank you! This has been bugging me for a few days :)

Pushed by kmadan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/861b996fbea1 Fix the Optimizely shim for medium.com, r=twisniewski,webcompat-reviewers
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: