Skip to content
This repository has been archived by the owner on Mar 5, 2019. It is now read-only.

Commit

Permalink
Merge branch 'Fx35-callee' into Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yfdyh000 committed Jan 25, 2015
2 parents 0c76404 + 355bb1e commit 04998c8
Show file tree
Hide file tree
Showing 7 changed files with 635 additions and 9 deletions.
1 change: 1 addition & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
content tabutils chrome/content/
skin tabutils classic/1.0 chrome/skin/
resource tabmixplus modules/

overlay chrome://browser/content/browser.xul chrome://tabutils/content/tabutils.xul
overlay chrome://browser/content/places/placesOverlay.xul chrome://tabutils/content/placesOverlay.xul
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/tabutils-mt.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ tabutils._multirowTabs = function() {
}, true);

TU_hookCode("gBrowser.moveTabTo", "{", function() {
if (["onxbldrop", "ondrop"].indexOf(arguments.callee.caller.name) > -1) {
if (TMP_console.isCallerInList(["onxbldrop", "ondrop"])) {
if (aTab.pinned) {
if (aIndex >= this._numPinnedTabs)
this.pinTab(aTab, false);
Expand Down
14 changes: 7 additions & 7 deletions chrome/content/tabutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ tabutils._singleWindowMode = function() {
});

TU_hookCode("gBrowser.replaceTabWithWindow", "{", function() {
if (["_onDragEnd", "onxbldragend"].indexOf(arguments.callee.caller.name) > -1 && TU_getPref("extensions.tabutils.singleWindowMode", false))
if (TMP_console.isCallerInList(["_onDragEnd", "onxbldragend"]) && TU_getPref("extensions.tabutils.singleWindowMode", false))
return null;
});

Expand Down Expand Up @@ -699,7 +699,7 @@ tabutils._tabOpeningOptions = function() {
[/return/g, "var tab ="],
["}", function() {
this.detachTab(tab, true);
if (["_onDrop", "onxbldrop", "duplicateTabIn"].indexOf(arguments.callee.caller.name) == -1) {
if (TMP_console.isCallerInList(["_onDrop", "onxbldrop", "duplicateTabIn"])) {
if (TU_getPref("extensions.tabutils.openDuplicateNext", true)) {
if (this.isStackedTab(aTab))
aTab = this.lastSiblingTabOf(aTab);
Expand All @@ -713,8 +713,8 @@ tabutils._tabOpeningOptions = function() {
);

//撤销关闭标签页
TU_hookCode("gBrowser.moveTabTo", "{", function() {
if (arguments.callee.caller.name == "ssi_undoCloseTab"
TU_hookCode("gBrowser.moveTabTo", "}", function() {
if (TMP_console.callerName() == "ssi_undoCloseTab"
&& !TU_getPref("extensions.tabutils.restoreOriginalPosition", true))
return;
});
Expand Down Expand Up @@ -1980,7 +1980,7 @@ tabutils._multiTabHandler = function() {

TU_hookCode("gBrowser.swapBrowsersAndCloseOther", /(?=.*_beginRemoveTab.*)/, function() {
if ([gBrowserInit.onLoad, gBrowserInit._delayedStartup].indexOf(arguments.callee.caller) > -1 || // Bug 756313 [Fx19]
["onxbldrop", "_handleTabDrop"].indexOf(arguments.callee.caller.name) > -1) {
TMP_console.isCallerInList(["onxbldrop", "_handleTabDrop"])) {
let selectedTabs = aOtherTab._selectedTabs || remoteBrowser.contextTabsOf(aOtherTab);
if (selectedTabs.length > 1) {
this.swapBrowsersAndCloseOther(aOurTab, selectedTabs.shift());
Expand Down Expand Up @@ -2057,7 +2057,7 @@ tabutils._tabClickingOptions = function() {

TU_hookCode("TabContextMenu.updateContextMenu", "aPopupMenu.triggerNode", "document.popupNode", "g");
TU_hookCode("gBrowser.mTabContainer._selectNewTab", "{", function() {
if (["onxblmousedown"].indexOf(arguments.callee.caller.name) > -1 &&
if (TMP_console.isCallerInList(["onxblmousedown"]) &&
!aNewTab.selected)
aNewTab.setAttribute("firstclick", true);
});
Expand Down Expand Up @@ -2285,7 +2285,7 @@ tabutils._tabClickingOptions = function() {

//Mouse release to select
TU_hookCode("gBrowser.mTabContainer._selectNewTab", "{", function() {
if (["onxblmousedown"].indexOf(arguments.callee.caller.name) > -1 &&
if (TMP_console.isCallerInList(["onxblmousedown"]) &&
TU_getPref("extensions.tabutils.mouseReleaseSelect", true))
return;
});
Expand Down
6 changes: 6 additions & 0 deletions chrome/content/tulib.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
let {classes: Cc, interfaces: Ci, utils: Cu} = Components;

XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
"resource://tabmixplus/Services.jsm");
let TMP_console = TabmixSvc.console;

function TU_hookCode(aStr) {
try {
var namespaces = aStr.split(".");
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/utilityOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

TU_hookCode("whereToOpenLink", "{", function() {
var target;
switch (arguments.callee.caller.name) {
switch (TMP_console.callerName()) {
case "PUIU_openNodeWithEvent": //Fx 4.0
case "PUIU__openTabset":
target = "bookmarks";break;
Expand Down
Loading

0 comments on commit 04998c8

Please sign in to comment.