mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-14 08:25:45 +01:00
Disable tab numbers on Gecko<2 again.
This commit is contained in:
@@ -242,31 +242,25 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
clipboardRead: function clipboardRead(getClipboard) {
|
clipboardRead: function clipboardRead(getClipboard) {
|
||||||
let str = null;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
|
const clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
|
||||||
const transferable = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable);
|
const transferable = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable);
|
||||||
|
|
||||||
transferable.addDataFlavor("text/unicode");
|
transferable.addDataFlavor("text/unicode");
|
||||||
|
|
||||||
if (!getClipboard && clipboard.supportsSelectionClipboard())
|
let source = clipboard[getClipboard || !clipboard.supportsSelectionClipboard() ?
|
||||||
clipboard.getData(transferable, clipboard.kSelectionClipboard);
|
"kSelectionClipboard" : "kGlobalClipboard"];
|
||||||
else
|
clipboard.getData(transferable, source);
|
||||||
clipboard.getData(transferable, clipboard.kGlobalClipboard);
|
|
||||||
|
|
||||||
let data = {};
|
let str = {}, len = {};
|
||||||
let dataLen = {};
|
transferable.getTransferData("text/unicode", str, len);
|
||||||
|
|
||||||
transferable.getTransferData("text/unicode", data, dataLen);
|
if (str)
|
||||||
|
return str.value.QueryInterface(Ci.nsISupportsString)
|
||||||
if (data) {
|
.data.substr(0, len.value / 2);
|
||||||
data = data.value.QueryInterface(Ci.nsISupportsString);
|
|
||||||
str = data.data.substring(0, dataLen.value / 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
return str;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1369,7 +1363,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
}
|
}
|
||||||
if (config.tabbrowser.tabContainer._positionPinnedTabs)
|
if (config.tabbrowser.tabContainer._positionPinnedTabs)
|
||||||
config.tabbrowser.tabContainer._positionPinnedTabs();
|
config.tabbrowser.tabContainer._positionPinnedTabs();
|
||||||
}
|
},
|
||||||
|
validator: function (opts) dactyl.has("Gecko2") ||
|
||||||
|
Option.validIf(!/[nN]/.test(opts), "Tab numbering not available in this " + config.host + " version")
|
||||||
|
|
||||||
}
|
}
|
||||||
].filter(function (group) !group.feature || dactyl.has(group.feature));
|
].filter(function (group) !group.feature || dactyl.has(group.feature));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user