Using a context-specific Touch Bar button crashes the browser
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
Touch Bar inputs in kImplemententedInputs
in MacTouchBar.js
have an optional context()
property that determines if an input should appear in the current context. context()
is a function that returns the name of the input that should appear in a specified context. Usually, an input will return it's own name if it should appear in a particular context and undefined
otherwise.
The issue is that the current code that sets the Touch Bar layout does not handle undefined
, causing a browser crash. The browser can't be reopened until the ui.touchbar.layout
pref is updated to remove the input whose context
property returns undefined
.
As an example, kImplementedInputs
currently has an input Focus:
Focus: {
title: "close-window",
image: "private-browsing.pdf",
type: "mainButton",
callback: () => execCommand("cmd_closeWindow", "Focus"),
color: "#8000D7",
context: () => {
let name;
if (PrivateBrowsingUtils.isWindowPrivate(BrowserWindowTracker.getTopWindow())) {
name = "Focus";
}
return name;
},
},
context()
returns "Focus" when in PBM, meaning that the Focus input should appear in PBM. However, if a user adds the Focus input to their Touch Bar and has a non-Private browser window open, the browser will crash since name
returns as undefined
.
This is a serious crash but a quick fix. I will submit the fix as soon as this bug is up.
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
spohl, I've tagged you for review since I believe it's quite late in Mike's timezone right now. This is a big crash with a quick fix, so it'd be great to get it out overnight!
Updated•6 years ago
|
Comment 4•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Updated•6 years ago
|
Updated•3 years ago
|
Description
•