Commit 227f47e8 authored by Ximin Luo's avatar Ximin Luo

Update upstream source from tag 'upstream/2.5.4'

Update to upstream version '2.5.4'
with Debian dir 2fcc1dc6978ac118d5c2e86e3241c2ca24e6f47f
parents 54994373 62c7860a
This diff is collapsed.
No preview for this file type
Signature-Version: 1.0
MD5-Digest-Manifest: Y7V+bBaEda7q4AeIl5hgpQ==
SHA1-Digest-Manifest: NyM8/NQUfmZDmjaBEwIicz1HAmY=
SHA256-Digest-Manifest: HMzIqsEjU3c4Y1vlJV/SIv0xX+8jUkAePxxJLASNoTY=
MD5-Digest-Manifest: wQOsGQAIPTbQ3wZGmZBEuw==
SHA1-Digest-Manifest: KpXg2LvfRNuPzFrWyVcUBydYqhg=
SHA256-Digest-Manifest: VXikbAzJ9+i4LzWaWT3xPMHrBg9Xv7mtM57ATmNrYzg=
File mode changed from 100755 to 100644
This diff is collapsed.
......@@ -15,6 +15,8 @@
"command_focusPreviousSilently": { "message": "Focus to Previous Tab (don't expand tree)" },
"command_focusNext": { "message": "Focus to Next Tab (expand tree)" },
"command_focusNextSilently": { "message": "Focus to Next Tab (don't expand tree)" },
"command_focusParent": { "message": "Focus to Parent Tab" },
"command_focusFirstChild": { "message": "Focus to First Child Tab" },
"command_tabbarUp": { "message": "Scroll Tabs Up by Line" },
"command_tabbarPageUp": { "message": "Scroll Tabs Up by Page" },
"command_tabbarHome": { "message": "Scroll Tabs to Top" },
......@@ -23,9 +25,12 @@
"command_tabbarEnd": { "message": "Scroll Tabs to End" },
"tab_closebox_tab_tooltip": { "message": "Close tab" },
"tab_closebox_tab_tooltip_multiselected": { "message": "Close tabs" },
"tab_closebox_tree_tooltip": { "message": "Close tree" },
"tab_soundButton_muted_tooltip": { "message": "Unmute tab" },
"tab_soundButton_muted_tooltip_multiselected": { "message": "Unmute tabs" },
"tab_soundButton_playing_tooltip": { "message": "Mute tab" },
"tab_soundButton_playing_tooltip_multiselected": { "message": "Mute tabs" },
"tab_twisty_expanded_tooltip": { "message": "Collapse tree" },
"tab_twisty_collapsed_tooltip": { "message": "Expand tree" },
"tab_tree_tooltip": { "message": "$TREE$\n ...and $COUNT$ more tab(s)",
......@@ -49,17 +54,19 @@
"title": { "content": "$1", "example": "title" }
}},
"groupTab_label_default": { "message": "Group" },
"groupTab_temporary_label": { "message": "Close this tab when there is no more child" },
"groupTab_temporary_label": { "message": "Close this tab when there are no more child" },
"groupTab_fromPinnedTab_label": { "message": "Tabs from $TITLE$",
"placeholders": {
"title": { "content": "$1", "example": "title" }
}},
"bookmarkFolder_label": { "message": "$TITLE$ and more",
"bookmarkFolder_label_default": { "message": "$TITLE$ and more (%YEAR%.%MONTH%.%DATE%)",
"placeholders": {
"title": { "content": "$1", "example": "title" }
"title": { "content": "$1", "example": "Title" },
"year": { "content": "$2", "example": "2018" },
"month": { "content": "$3", "example": "06" },
"date": { "content": "$4", "example": "21" }
}},
"bookmarkFolder_label_default": { "message": "Bookmarked Tree" },
"bookmarkTree_notification_success_title": { "message": "Tree is Successfully Bookmarked" },
"bookmarkTree_notification_success_message": { "message": "$COUNT$ tabs including \"$TITLE$\" are bookmarked in a new folder under \"$PARENT$.",
......@@ -120,10 +127,16 @@
"context_closeTree_label": { "message": "&Close this Tree" },
"context_closeDescendants_label": { "message": "C&lose Descendants" },
"context_closeOthers_label": { "message": "Cl&ose Other Tabs except this Tree" },
"context_collapseTree_label": { "message": "Collap&se this Tree" },
"context_collapseAll_label": { "message": "Colla&pse All" },
"context_expandTree_label": { "message": "Exp&and this Tree" },
"context_expandAll_label": { "message": "E&xpand All" },
"context_bookmarkTree_label": { "message": "&Bookmark this Tree…" },
"context_collapsed_label": { "message": "Collapsed (for testing of a checkbox type menu)" },
"context_pinnedTab_label": { "message": "Pinned (for testing of a radio type menu)" },
"context_unpinnedTab_label": { "message": "Unpinned (for testing of a radio type menu)" },
"config_appearance_caption": { "message": "Appearance" },
......@@ -178,8 +191,8 @@
"config_longPressOnNewTabButton_contextualIdentities": { "message": "choose container" },
"config_longPressOnNewTabButton_none": { "message": "(nothing)" },
"config_longPressOnNewTabButton_after": { "message": "\u200b" },
"config_showNewTabActionSelector_label": { "message": "Show selector button on the \"New Tab\" button, to specify where the new tab is opened in" },
"config_showContextualIdentitiesSelector_label": { "message": "Show container selector button on the \"New Tab\" button" },
"config_showNewTabActionSelector_label": { "message": "Show selector button on the \"New Tab\" button, to specify where the new tab is opened in, when the button is pointed" },
"config_showContextualIdentitiesSelector_label": { "message": "Show container selector button on the \"New Tab\" button, when the button is pointed" },
"config_newTabAction_caption": { "message": "Behavior for new tab actions (other toolbar buttons, keyboard shortcuts, and others)" },
"config_autoAttachOnNewTabCommand_before": { "message": "Open new blank tab as" },
......@@ -266,12 +279,20 @@
"config_warnOnCloseTabs_label": { "message": "Warn me when I attempt to close multiple tabs" },
"config_allowBookmarkCreationFromDraggedTree_caption": { "message": "When a tree is dragged outside of the tab bar" },
"config_allowBookmarkCreationFromDraggedTree_false": { "message": "Tear off from the window by default, create links or bookmarks by Shift-drag" },
"config_allowBookmarkCreationFromDraggedTree_true": { "message": "Create links or bookmarks by default, tear off from the window by Shift-drag" },
"config_shortcuts_caption": { "message": "Keyboard shortcuts" },
"config_advanced_caption": { "message": "Advanced" },
"config_bookmarkTreeFolderName_before": { "message": "Folder name for \"Bookmark this Tree\":" },
"config_bookmarkTreeFolderName_after": { "message": "\u200b" },
"config_bookmarkTreeFolderName_description": { "message": "Available placeholders: %TITLE% (title of the first tab), %URL% (URL of the first tab), %YEAR% (year, four digits), %MONTH% (month, two digits), %DATE% (date, two digits)" },
"config_userStyleRules_label": { "message": "Extra style rules for sidebar contents" },
"config_userStyleRules_description_before": { "message": "For more options, see " },
"config_userStyleRules_description_link_label": { "message": "code snippets at TST wiki" },
......@@ -312,16 +333,14 @@
"config_debug_label": { "message": "Debug mode" },
"config_log_caption": { "message": "Detailed logging" },
"config_logOnUpdated_label": { "message": "Print logs from tabs.onUpdated" },
"config_logOnMouseEvent_label": { "message": "Print logs from mouse events" },
"config_logOnScroll_label": { "message": "Print logs from auto scrolling" },
"config_logOnCollapseExpand_label": { "message": "Print logs from collapse/expand" },
"config_logOnCache_label": { "message": "Print logs from cached tree" },
"config_logOnFakeContextMenu_label": { "message": "Print logs from fake context menu" },
"config_logFor_common": { "message": "Logs from common modules" },
"config_logFor_background": { "message": "Logs from background modules" },
"config_logFor_sidebar": { "message": "Logs from sidebar modules" },
"config_simulateSVGContextFill_label": { "message": "Activate workaround for the Bug 1388193 and Bug 1421329 to simulate SVG icons (*This may increase CPU usage. To deactivate this option, you need to activate \"svg.context-properties.content.enabled\" via \"about:config\", until these bugs are fixed.)" },
"config_useCachedTree_label": { "message": "Optimize tree restoration with cache" },
"config_useCachedTree_description": { "message": "*Please try unchecking and re-checking this to refresh the cache, when the behavior around tree is unstable." },
"config_acccelaratedTabDuplication_label": { "message": "Accelarate operations around tab duplication (*NOTE: You'll see unstable behavior around tabs.)" },
"config_acceleratedTabCreation_label": { "message": "Accelerate operations around newly opened tabs (*NOTE: You'll see unstable behavior around tabs.)" },
"config_acceleratedTabDuplication_label": { "message": "Accelerate operations around tab duplication (*NOTE: You'll see unstable behavior around tabs.)" },
"config_maximumAcceptableDelayForTabDuplication_before": { "message": "Abort tab duplication when it takes" },
"config_maximumAcceptableDelayForTabDuplication_after": { "message": "milliseconds or more." },
"config_sidebarScrollbarPosition_caption": { "message": "Position of the scrollbar:" },
......@@ -345,6 +364,8 @@
"tabContextMenu_pin_label": { "message": "&Pin Tab" },
"tabContextMenu_unpin_label": { "message": "Unpin Ta&b" },
"tabContextMenu_duplicate_label": { "message": "&Duplicate Tab" },
"tabContextMenu_reopenInContainer_label": { "message": "R&eopen in Container" },
"tabContextMenu_reopenInContainer_noContainer_label": { "message": "&No Container" },
"tabContextMenu_tearOff_label": { "message": "Move to New &Window" },
"tabContextMenu_reloadAll_label": { "message": "Reload &All Tabs" },
......@@ -353,5 +374,16 @@
"tabContextMenu_closeOther_label": { "message": "Cl&ose Other Tabs" },
"tabContextMenu_undoClose_label": { "message": "&Undo Close Tab" },
"tabContextMenu_close_label": { "message": "&Close Tab" }
"tabContextMenu_close_label": { "message": "&Close Tab" },
"tabContextMenu_reload_label_multiselected": { "message": "&Reload Selected Tabs" },
"tabContextMenu_mute_label_multiselected": { "message": "M&ute Tabs" },
"tabContextMenu_unmute_label_multiselected": { "message": "Unmute Ta&bs" },
"tabContextMenu_pin_label_multiselected": { "message": "&Pin Tabs" },
"tabContextMenu_unpin_label_multiselected": { "message": "Unpin Ta&bs" },
"tabContextMenu_bookmark_label_multiselected": { "message": "Boo&kmark Tabs…" },
"tabContextMenu_close_label_multiselected": { "message": "Close &Selected Tabs" }
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -55,11 +55,13 @@
"title": { "content": "$1", "example": "標題" }
}},
"bookmarkFolder_label": { "message": "$TITLE$ 等",
"bookmarkFolder_label_default": { "message": "$TITLE$ 等 (%YEAR%.%MONTH%.%DATE%)",
"placeholders": {
"title": { "content": "$1", "example": "標題" }
"title": { "content": "$1", "example": "Title" },
"year": { "content": "$2", "example": "2018" },
"month": { "content": "$3", "example": "06" },
"date": { "content": "$4", "example": "21" }
}},
"bookmarkFolder_label_default": { "message": "已加入書籤的樹" },
"bookmarkTree_notification_success_title": { "message": "此樹已加入書籤" },
"bookmarkTree_notification_success_message": { "message": "「$TITLE$」等 $COUNT$ 個分頁已加入「$PARENT$」內的新資料夾中",
......@@ -299,7 +301,7 @@
"config_logOnCollapseExpand_label": { "message": "輸出折疊展開樹的相關日誌" },
"config_simulateSVGContextFill_label": { "message": "模擬 SVG 圖標以解決 Bug 1388193 及 Bug 1421329 (※可能會提高 CPU 用量。在 Bug 修正前,若想禁用此選項必須啟用「about:config」的「svg.context-properties.content.enabled」)" },
"config_useCachedTree_label": { "message": "以快取加速樹狀結構初始化" },
"config_acccelaratedTabDuplication_label": { "message": "加快分頁複制(※動作會不穩定)" },
"config_acceleratedTabDuplication_label": { "message": "加快分頁複制(※動作會不穩定)" },
"config_maximumAcceptableDelayForTabDuplication_before": { "message": "\u200b" },
"config_maximumAcceptableDelayForTabDuplication_after": { "message": "亳秒內未複制完成即中斷。" },
"config_sidebarScrollbarPosition_caption": { "message": "捲軸位置" },
......
This diff is collapsed.
......@@ -5,31 +5,7 @@
<html>
<head>
<meta charset="UTF-8">
<script type="application/javascript" src="/common/tree/constants.js"></script>
<script type="application/javascript" src="/common/fake-context-menu/constants.js"></script>
<script type="application/javascript" src="/common/fake-context-menu/background.js"></script>
<script type="application/javascript" src="/common/Configs.js"></script>
<script type="application/javascript" src="/common/common.js"></script>
<script type="application/javascript" src="/common/xpath.js"></script>
<script type="application/javascript" src="/common/TabIdFixer.js"></script>
<script type="application/javascript" src="/common/TabFavIconHelper.js"></script>
<script type="application/javascript" src="/common/MetricsData.js"></script>
<script type="application/javascript" src="/common/permissions.js"></script>
<script type="application/javascript" src="/common/RichConfirm.js"></script>
<script type="application/javascript" src="/common/tree/base.js"></script>
<script type="application/javascript" src="/common/tree/api-tabs.js"></script>
<script type="application/javascript" src="/common/tree/get-tabs.js"></script>
<script type="application/javascript" src="/common/tree/tab-information.js"></script>
<script type="application/javascript" src="/common/tree/tree-operations.js"></script>
<script type="application/javascript" src="/common/tree/cache.js"></script>
<script type="application/javascript" src="/common/tree/contextual-identities.js"></script>
<script type="application/javascript" src="/common/tree/handlers.js"></script>
<script type="application/javascript" src="/common/commands.js"></script>
<script type="application/javascript" src="/background/background.js"></script>
<script type="application/javascript" src="/background/cache.js"></script>
<script type="application/javascript" src="/background/handlers.js"></script>
<script type="application/javascript" src="/background/context-menu.js"></script>
<script type="application/javascript" src="/background/migration.js"></script>
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="all-tabs"></div>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
import {
log as internalLogger
} from '/common/common.js';
import * as Tabs from '/common/tabs.js';
function log(...args) {
internalLogger('background/handle-tab-multiselect', ...args);
}
Tabs.onUpdated.addListener((tab, info) => {
if (!('highlighted' in info) ||
!Tabs.isSubtreeCollapsed(tab) ||
Tabs.isCollapsed(tab))
return;
const collapsedDescendants = Tabs.getDescendantTabs(tab);
log('inherit highlighted state from root visible tab: ', {
highlighted: info.highlighted,
collapsedDescendants
});
for (const descendant of collapsedDescendants) {
browser.tabs.update(descendant.apiTab.id, {
highlighted: info.highlighted,
active: Tabs.isActive(descendant)
});
}
});
function getTabsBetween(begin, end) {
if (!begin || !begin.parentNode ||
!end || !end.parentNode)
throw new Error('getTabsBetween requires valid two tabs');
if (begin.parentNode != end.parentNode)
throw new Error('getTabsBetween requires two tabs in same window');
if (begin == end)
return [];
let inRange = false;
return Array.slice(begin.parentNode.children).filter(tab => {
if (tab == begin || tab == end) {
inRange = !inRange;
return false;
}
return inRange;
});
}
const mLastClickedTabInWindow = new WeakMap();
export async function updateSelectionByTabClick(tab, event) {
const ctrlKeyPressed = event.ctrlKey || (event.metaKey && /^Mac/i.test(navigator.platform));
const activeTab = Tabs.getCurrentTab(tab);
if (event.shiftKey) {
// select the clicked tab and tabs between last activated tab
const lastClickedTab = mLastClickedTabInWindow.get(tab.parentNode) || activeTab;
const betweenTabs = getTabsBetween(lastClickedTab, tab, tab.parentNode.children);
const targetTabs = [lastClickedTab].concat(betweenTabs);
if (tab != lastClickedTab)
targetTabs.push(tab);
try {
if (!ctrlKeyPressed) {
const alreadySelectedTabs = Tabs.getSelectedTabs(tab);
log('clear old selection by shift-click: ', alreadySelectedTabs);
for (const alreadySelectedTab of alreadySelectedTabs) {
if (!targetTabs.includes(alreadySelectedTab))
browser.tabs.update(alreadySelectedTab.apiTab.id, { highlighted: false });
}
}
log('set selection by shift-click: ', targetTabs);
for (const toBeSelectedTab of targetTabs) {
if (Tabs.isHighlighted(toBeSelectedTab))
continue;
browser.tabs.update(toBeSelectedTab.apiTab.id, {
highlighted: true,
active: Tabs.isActive(toBeSelectedTab)
});
}
}
catch(_e) { // not implemented on old Firefox
return false;
}
return true;
}
else if (ctrlKeyPressed) {
// toggle selection of the tab and all collapsed descendants
try {
log('change selection by ctrl-click: ', tab);
if (!Tabs.isMultiselected(activeTab) &&
Tabs.isSubtreeCollapsed(activeTab)) {
// multiselect all collapsed descendants to prevent ony the root tab is dragged.
for (const descendant of Tabs.getDescendantTabs(activeTab)) {
if (!Tabs.isHighlighted(descendant))
browser.tabs.update(descendant.apiTab.id, {
highlighted: true,
active: false
});
}
}
browser.tabs.update(tab.apiTab.id, {
highlighted: !Tabs.isHighlighted(tab),
active: Tabs.isActive(tab)
});
}
catch(_e) { // not implemented on old Firefox
return false;
}
mLastClickedTabInWindow.set(tab.parentNode, tab);
return true;
}
else {
mLastClickedTabInWindow.set(tab.parentNode, tab);
return false;
}
}
This diff is collapsed.
This diff is collapsed.
/*
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import '../extlib/TabIdFixer.js';
import {
log
} from '/common/common.js';
import * as MetricsData from '/common/metrics-data.js';
import * as Background from './background.js';
import './handle-new-tabs.js';
import './handle-removed-tabs.js';
import './handle-tab-focus.js';
import './handle-tab-multiselect.js';
import './handle-moved-tabs.js';
import './handle-tree-changes.js';
import './handle-group-tabs.js';
import './handle-misc.js';
import './context-menu.js';
import './tab-context-menu.js';
log.context = 'BG';
MetricsData.add('index: Loaded');
window.addEventListener('DOMContentLoaded', Background.init, { once: true });
window.dumpMetricsData = () => {
return MetricsData.toString();
};
window.dumpLogs = () => {
return log.logs.join('\n');
};
// for old debugging method
window.log = log;
window.gMetricsData = MetricsData;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/*
Workaround until native context menu becomes available.
I have very less motivation to maintain this for future versions.
See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1376251
https://bugzilla.mozilla.org/show_bug.cgi?id=1396031
*/
const kTSTAPI_CONTEXT_MENU_UPDATED = 'fake-contextMenu-updated';
const kTSTAPI_CONTEXT_MENU_GET_ITEMS = 'fake-contextMenu-get-items';
const kTSTAPI_CONTEXT_MENU_OPEN = 'fake-contextMenu-open';
const kTSTAPI_CONTEXT_MENU_CREATE = 'fake-contextMenu-create';
const kTSTAPI_CONTEXT_MENU_UPDATE = 'fake-contextMenu-update';
const kTSTAPI_CONTEXT_MENU_REMOVE = 'fake-contextMenu-remove';
const kTSTAPI_CONTEXT_MENU_REMOVE_ALL = 'fake-contextMenu-remove-all';
const kTSTAPI_CONTEXT_MENU_CLICK = 'fake-contextMenu-click';
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -51,3 +51,4 @@ var l10n = {
document.addEventListener('DOMContentLoaded', () => {
l10n.updateDocument();
}, { once: true });
window.l10n = l10n;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
File mode changed from 100755 to 100644
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.