Skip to content

Commit

Permalink
132.0b8
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Oct 17, 2024
1 parent 56b2c3a commit 1258326
Show file tree
Hide file tree
Showing 140 changed files with 6,091 additions and 876 deletions.
3 changes: 1 addition & 2 deletions firefox-src-part/browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,14 +1871,13 @@ pref("browser.newtabpage.activity-stream.discoverystream.merino-provider.enabled
// List of regions that get topics selection by default.
pref("browser.newtabpage.activity-stream.discoverystream.topicSelection.region-topics-config", "US, CA");
pref("browser.newtabpage.activity-stream.discoverystream.topicSelection.onboarding.enabled", true);
pref("browser.newtabpage.activity-stream.discoverystream.topicLabels.region-topic-label-config", "US, CA");
#else
pref("browser.newtabpage.activity-stream.discoverystream.topicSelection.region-topics-config", "");
pref("browser.newtabpage.activity-stream.discoverystream.topicSelection.onboarding.enabled", false);
pref("browser.newtabpage.activity-stream.discoverystream.topicLabels.region-topic-label-config", "");
#endif

// List of locales that get topics selection by default.
pref("browser.newtabpage.activity-stream.discoverystream.topicLabels.region-topic-label-config", "US, CA");
pref("browser.newtabpage.activity-stream.discoverystream.topicSelection.locale-topics-config", "en-US, en-GB, en-CA");
pref("browser.newtabpage.activity-stream.discoverystream.topicLabels.locale-topic-label-config", "en-US, en-GB, en-CA");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ var FullScreen = {
// e.g. we wouldn't want the autoscroll icon firing this event, so when the user
// toggles chrome when moving mouse to the top, it doesn't go away again.
let target = aEvent.originalTarget;
if (target.localName == "tooltip") {
if (target.localName == "tooltip" || target.id == "tab-preview-panel") {
return;
}
if (
Expand Down
5 changes: 1 addition & 4 deletions firefox-src-part/browser/base/content/browser-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ var gBrowserInit = {

// We don't want these normally non-removable elements to get put back into the
// tabstrip if we're initializing with vertical tabs
let nonRemovables = [
gBrowser.tabContainer,
document.getElementById("alltabs-button"),
];
let nonRemovables = [gBrowser.tabContainer];
for (let elem of nonRemovables) {
elem.setAttribute("removable", "true");
// tell CUI to ignore this element when it builds the toolbar areas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
onkeypress="gTabsPanel.showAllTabsPanel(event, 'alltabs-button');"
onmousedown="gTabsPanel.showAllTabsPanel(event, 'alltabs-button');"
data-l10n-id="tabs-toolbar-list-all-tabs"
removable="false"/>
removable="true"/>
</hbox>
</hbox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3998,6 +3998,33 @@ var CustomizableUIInternal = {
}
},

widgetIsLikelyVisible(aWidgetId, window) {
let placement = this.getPlacementOfWidget(aWidgetId);

if (!placement) {
return false;
}

switch (placement.area) {
case CustomizableUI.AREA_NAVBAR:
return true;
case CustomizableUI.AREA_MENUBAR:
return !this.getCollapsedToolbarIds(window).has(
CustomizableUI.AREA_MENUBAR
);
case CustomizableUI.AREA_TABSTRIP:
return !CustomizableUI.verticalTabsEnabled;
case CustomizableUI.AREA_BOOKMARKS:
return (
Services.prefs.getCharPref(
"browser.toolbars.bookmarks.visibility"
) === "always"
);
default:
return false;
}
},

observe(aSubject, aTopic, aData) {
if (aTopic == "browser-set-toolbar-visibility") {
let [toolbar, visibility] = JSON.parse(aData);
Expand Down Expand Up @@ -4191,7 +4218,6 @@ var CustomizableUIInternal = {

// Normally these aren't removable, but for this operation only we need to move them
changeWidgetRemovability("tabbrowser-tabs", true);
changeWidgetRemovability("alltabs-button", true);

if (toVertical) {
lazy.log.debug(
Expand Down Expand Up @@ -4242,7 +4268,6 @@ var CustomizableUIInternal = {

lazy.log.debug("Reverting widgets to be non-removable");
changeWidgetRemovability("tabbrowser-tabs", false);
changeWidgetRemovability("alltabs-button", false);

this.setToolbarVisibility(
CustomizableUI.AREA_VERTICAL_TABSTRIP,
Expand Down Expand Up @@ -5107,6 +5132,27 @@ export var CustomizableUI = {
return CustomizableUIInternal.getCollapsedToolbarIds(window);
},

/**
* Checks if a widget is likely visible in a given window.
*
* This method returns true when a widget is:
* - Not pinned to the overflow menu
* - Not in a collapsed toolbar (e.g. bookmarks toolbar, menu bar)
* - Not in the customization palette
*
* Note: A widget that is moved into the overflow menu due to
* the window being small might be considered visible by
* this method, because a widget's placement does not
* change when it overflows into the overflow menu.
*
* @param aWidgetId the widget ID to check.
* @param {Window} window The browser window to check for widget visibility.
* @returns {Boolean} whether the given widget is likely visible or not.
*/
widgetIsLikelyVisible(aWidgetId, window) {
return CustomizableUIInternal.widgetIsLikelyVisible(aWidgetId, window);
},

/**
* DEPRECATED! Use fluent instead.
*
Expand Down
12 changes: 12 additions & 0 deletions firefox-src-part/browser/components/extensions/parent/ext-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

ChromeUtils.defineESModuleGetters(this, {
BrowserUIUtils: "resource:///modules/BrowserUIUtils.sys.mjs",
CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs",
DownloadPaths: "resource://gre/modules/DownloadPaths.sys.mjs",
ExtensionControlledPopup:
"resource:///modules/ExtensionControlledPopup.sys.mjs",
Expand Down Expand Up @@ -1605,6 +1606,17 @@ this.tabs = class extends ExtensionAPIPersistent {
}
if (hidden.length) {
let win = Services.wm.getMostRecentWindow("navigator:browser");

// Before showing the hidden tabs warning,
// move alltabs-button to somewhere visible if it isn't already.
if (!CustomizableUI.widgetIsLikelyVisible("alltabs-button", win)) {
CustomizableUI.addWidgetToArea(
"alltabs-button",
CustomizableUI.verticalTabsEnabled
? CustomizableUI.AREA_NAVBAR
: CustomizableUI.AREA_TABSTRIP
);
}
tabHidePopup.open(win, extension.id);
}
return hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class _DSCard extends React.PureComponent {

doesLinkTopicMatchSelectedTopic() {
// Edge case for clicking on a card when topic selections have not be set
if (this.props.selectedTopics === "") {
if (!this.props.selectedTopics) {
return "not-set";
}

Expand Down Expand Up @@ -667,6 +667,7 @@ export class _DSCard extends React.PureComponent {
recommended_at: this.props.recommended_at,
received_rank: this.props.received_rank,
topic: this.props.topic,
is_list_card: this.props.isListCard,
},
]}
dispatch={this.props.dispatch}
Expand Down Expand Up @@ -731,6 +732,7 @@ export class _DSCard extends React.PureComponent {
scheduled_corpus_item_id={this.props.scheduled_corpus_item_id}
recommended_at={this.props.recommended_at}
received_rank={this.props.received_rank}
is_list_card={this.props.isListCard}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class DSLinkMenu extends React.PureComponent {
scheduled_corpus_item_id: this.props.scheduled_corpus_item_id,
recommended_at: this.props.recommended_at,
received_rank: this.props.received_rank,
is_list_card: this.props.is_list_card,
}}
/>
</ContextMenuButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function ListFeed({ type, firstVisibleTimestamp, recs }) {
const { length: listLength } = listFeedRecs;
// determine if the list should take up all availible height or not
const fullList = listLength >= 5;

return (
listLength > 0 && (
<div
Expand Down Expand Up @@ -48,7 +49,7 @@ function ListFeed({ type, firstVisibleTimestamp, recs }) {
return (
<DSCard
key={`list-card-${index}`}
pos={rec.pos}
pos={index}
flightId={rec.flight_id}
image_src={rec.image_src}
raw_image_src={rec.raw_image_src}
Expand All @@ -60,7 +61,6 @@ function ListFeed({ type, firstVisibleTimestamp, recs }) {
url={rec.url}
id={rec.id}
shim={rec.shim}
fetchTimestamp={rec.fetchTimestamp}
type={type}
context={rec.context}
sponsor={rec.sponsor}
Expand All @@ -71,7 +71,6 @@ function ListFeed({ type, firstVisibleTimestamp, recs }) {
pocket_id={rec.pocket_id}
context_type={rec.context_type}
bookmarkGuid={rec.bookmarkGuid}
recommendation_id={rec.recommendation_id}
firstVisibleTimestamp={firstVisibleTimestamp}
scheduled_corpus_item_id={rec.scheduled_corpus_item_id}
recommended_at={rec.recommended_at}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@
.story-footer {
margin-block-start: var(--space-xsmall);
}

.source {
margin-bottom: 1px;
}

.title {
font-size: var(--font-size-small);
line-height: 19px;
}

}

.excerpt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const LinkMenuOptions = {
position: pos,
...(site.sponsored_tile_id ? { tile_id: site.sponsored_tile_id } : {}),
is_pocket_card: site.type === "CardGrid",
is_list_card: site.is_list_card,
})),
}),
impression: ac.ImpressionStats({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6231,6 +6231,13 @@ main section {
.ds-card-grid .list-feed-content .ds-card.list-feed-card .meta .story-footer {
margin-block-start: var(--space-xsmall);
}
.ds-card-grid .list-feed-content .ds-card.list-feed-card .meta .source {
margin-bottom: 1px;
}
.ds-card-grid .list-feed-content .ds-card.list-feed-card .meta .title {
font-size: var(--font-size-small);
line-height: 19px;
}
.ds-card-grid .list-feed-content .ds-card.list-feed-card .excerpt {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,7 @@ const LinkMenuOptions = {
position: pos,
...(site.sponsored_tile_id ? { tile_id: site.sponsored_tile_id } : {}),
is_pocket_card: site.type === "CardGrid",
is_list_card: site.is_list_card,
})),
}),
impression: actionCreators.ImpressionStats({
Expand Down Expand Up @@ -2077,7 +2078,8 @@ class DSLinkMenu extends (external_React_default()).PureComponent {
recommendation_id: this.props.recommendation_id,
scheduled_corpus_item_id: this.props.scheduled_corpus_item_id,
recommended_at: this.props.recommended_at,
received_rank: this.props.received_rank
received_rank: this.props.received_rank,
is_list_card: this.props.is_list_card
}
})));
}
Expand Down Expand Up @@ -2954,7 +2956,7 @@ class _DSCard extends (external_React_default()).PureComponent {
}
doesLinkTopicMatchSelectedTopic() {
// Edge case for clicking on a card when topic selections have not be set
if (this.props.selectedTopics === "") {
if (!this.props.selectedTopics) {
return "not-set";
}

Expand Down Expand Up @@ -3330,7 +3332,8 @@ class _DSCard extends (external_React_default()).PureComponent {
scheduled_corpus_item_id: this.props.scheduled_corpus_item_id,
recommended_at: this.props.recommended_at,
received_rank: this.props.received_rank,
topic: this.props.topic
topic: this.props.topic,
is_list_card: this.props.isListCard
}],
dispatch: this.props.dispatch,
source: this.props.type,
Expand Down Expand Up @@ -3384,7 +3387,8 @@ class _DSCard extends (external_React_default()).PureComponent {
block_key: this.props.id,
scheduled_corpus_item_id: this.props.scheduled_corpus_item_id,
recommended_at: this.props.recommended_at,
received_rank: this.props.received_rank
received_rank: this.props.received_rank,
is_list_card: this.props.isListCard
}))));
}
}
Expand Down Expand Up @@ -3699,7 +3703,7 @@ function ListFeed({
}
return /*#__PURE__*/external_React_default().createElement(DSCard, {
key: `list-card-${index}`,
pos: rec.pos,
pos: index,
flightId: rec.flight_id,
image_src: rec.image_src,
raw_image_src: rec.raw_image_src,
Expand All @@ -3711,7 +3715,6 @@ function ListFeed({
url: rec.url,
id: rec.id,
shim: rec.shim,
fetchTimestamp: rec.fetchTimestamp,
type: type,
context: rec.context,
sponsor: rec.sponsor,
Expand All @@ -3722,7 +3725,6 @@ function ListFeed({
pocket_id: rec.pocket_id,
context_type: rec.context_type,
bookmarkGuid: rec.bookmarkGuid,
recommendation_id: rec.recommendation_id,
firstVisibleTimestamp: firstVisibleTimestamp,
scheduled_corpus_item_id: rec.scheduled_corpus_item_id,
recommended_at: rec.recommended_at,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ export class DiscoveryStreamFeed {

if (unifiedAdsEnabled) {
const endpointBaseUrl = state.Prefs.values[PREF_UNIFIED_ADS_ENDPOINT];
endpoint = `${endpointBaseUrl}v1/ads`;
endpoint = `${endpointBaseUrl}v1/delete_user`;
body = {
context_id: lazy.contextId,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@ export class TelemetryFeed {
is_sponsored: datum.card_type === "spoc",
position: datum.pos,
tile_id: datum.id || datum.tile_id,
is_list_card: datum.is_list_card,
...(datum.scheduled_corpus_item_id
? {
scheduled_corpus_item_id: datum.scheduled_corpus_item_id,
Expand Down Expand Up @@ -1297,6 +1298,7 @@ export class TelemetryFeed {
}

const { tiles } = data;

tiles.forEach(tile => {
Glean.pocket.impression.record({
newtab_visit_id: session.session_id,
Expand All @@ -1305,6 +1307,7 @@ export class TelemetryFeed {
tile_id: tile.id,
topic: tile.topic,
selected_topics: tile.selectedTopics,
is_list_card: tile.is_list_card,
...(tile.scheduled_corpus_item_id
? {
scheduled_corpus_item_id: tile.scheduled_corpus_item_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const TOP_SITES_BLOCKED_SPONSORS_PREF = "browser.topsites.blockedSponsors";
const CONTILE_CACHE_PREF = "browser.topsites.contile.cachedTiles";
const CONTILE_CACHE_VALID_FOR_PREF = "browser.topsites.contile.cacheValidFor";
const CONTILE_CACHE_LAST_FETCH_PREF = "browser.topsites.contile.lastFetch";
const CONTILE_CACHE_VALID_FOR_FALLBACK = 3 * 60 * 60; // 3 hours in seconds

// Partners of sponsored tiles.
const SPONSORED_TILE_PARTNER_AMP = "amp";
Expand Down Expand Up @@ -417,7 +418,10 @@ export class ContileIntegration {
CONTILE_CACHE_LAST_FETCH_PREF,
0
);
const validFor = Services.prefs.getIntPref(CONTILE_CACHE_VALID_FOR_PREF, 0);
const validFor = Services.prefs.getIntPref(
CONTILE_CACHE_VALID_FOR_PREF,
CONTILE_CACHE_VALID_FOR_FALLBACK
);
this._topSitesFeed._telemetryUtility.setSponsoredTilesConfigured();
if (now <= lastFetch + validFor) {
try {
Expand Down Expand Up @@ -639,6 +643,11 @@ export class ContileIntegration {
response.headers.get("Cache-Control")
)
);
} else {
Services.prefs.setIntPref(
CONTILE_CACHE_VALID_FOR_PREF,
CONTILE_CACHE_VALID_FOR_FALLBACK
);
}

return true;
Expand Down Expand Up @@ -2000,6 +2009,7 @@ export class TopSitesFeed {
this.init();
this.updateCustomSearchShortcuts(true /* isStartup */);
break;
case at.DISCOVERY_STREAM_DEV_SYSTEM_TICK:
case at.SYSTEM_TICK:
this.refresh({ broadcast: false });
this._contile.periodicUpdate();
Expand Down
Loading

0 comments on commit 1258326

Please sign in to comment.