Closed Bug 1652487 Opened 4 years ago Closed 4 years ago

BrowserUsageTelemetry.jsm: SyntaxError: Element.closest: '#widget:[addonid]@jetpack-[widgetid]' is not a valid selector

Categories

(Firefox :: Toolbars and Customization, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 80
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- fixed
firefox78 --- wontfix
firefox79 --- fixed
firefox80 --- fixed

People

(Reporter: robwu, Assigned: mossop)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

I opened the global JS console and see the following error:

SyntaxError: Element.closest: '#widget:[addonid]@jetpack-[widgetid]' is not a valid selector BrowserUsageTelemetry.jsm:900
    _getWidgetID resource:///modules/BrowserUsageTelemetry.jsm:900
    _recordCommand resource:///modules/BrowserUsageTelemetry.jsm:1032
    _addUsageListeners resource:///modules/BrowserUsageTelemetry.jsm:1047

The code here in browser/modules/BrowserUsageTelemetry.jsm assumes that the input ID is a valid CSS selector. IDs do not have to be a valid CSS selector, to fix this CSS.escape should be used first.

This ID is somehow present in my xulstore.json, and originates from a Jetpack add-on that used the sdk/widget module - https://github.com/mozilla/addon-sdk/blob/e5ce4a3c956327c25e48d49754e09bac95b0897d/lib/sdk/widget.js#L701-L702

Assignee: nobody → dtownsend
Severity: -- → S3
Priority: -- → P1

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

(In reply to Rob Wu [:robwu] from comment #0)

CSS.escape

TIL!

Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/51d35deafcbb
Escape widget identifiers before using them as CSS selectors. r=Gijs
Flags: in-testsuite+
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 80

Is there a user impact which justifies backport consideration here?

Flags: needinfo?(dtownsend)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #6)

Is there a user impact which justifies backport consideration here?

So I don't think there is user impact. I do think it would be worth uplifting this to beta though. It breaks this interaction telemetry almost entirely for users in this state. Admittedly that number of users is probably small, but the fix is also trivial and safe.

Flags: needinfo?(dtownsend)

The patch landed in nightly and beta is affected.
:mossop, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(dtownsend)

Comment on attachment 9163900 [details]
Bug 1652487: Escape widget identifiers before using them as CSS selectors. r=Gijs!

Beta/Release Uplift Approval Request

  • User impact if declined: None however we lose some telemetry for those affected, that is likely a small number of folks though.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch just adds some additional escaping to strings, there is no risk of regression.
  • String changes made/needed:
Flags: needinfo?(dtownsend)
Attachment #9163900 - Flags: approval-mozilla-beta?

Comment on attachment 9163900 [details]
Bug 1652487: Escape widget identifiers before using them as CSS selectors. r=Gijs!

Seems like a simple-enough Telemetry fix. Approved for 79.0rc1 and 78.1esr.

Attachment #9163900 - Flags: approval-mozilla-esr78+
Attachment #9163900 - Flags: approval-mozilla-beta?
Attachment #9163900 - Flags: approval-mozilla-beta+
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: