mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 20:27:58 +01:00
Fallback to useable clipboard on Windows. Closes issue #690.
This commit is contained in:
@@ -378,10 +378,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
* @optional
|
||||
*/
|
||||
clipboardWrite: function clipboardWrite(str, verbose, which) {
|
||||
if (which == null)
|
||||
if (which == null || which == "selection" && !services.clipboard.supportsSelectionClipboard())
|
||||
services.clipboardHelper.copyString(str);
|
||||
else if (which == "selection" && !services.clipboard.supportsSelectionClipboard())
|
||||
return;
|
||||
else
|
||||
services.clipboardHelper.copyStringToClipboard(str,
|
||||
services.clipboard["k" + util.capitalize(which) + "Clipboard"]);
|
||||
|
||||
@@ -1518,6 +1518,7 @@ var Buffer = Module("Buffer", {
|
||||
},
|
||||
|
||||
_exWidth: function _exWidth(elem) {
|
||||
try {
|
||||
let div = DOM(<elem style="width: 1ex !important; position: absolute !important; padding: 0 !important; display: block;"/>,
|
||||
elem.ownerDocument).appendTo(elem.body || elem);
|
||||
try {
|
||||
@@ -1526,6 +1527,10 @@ var Buffer = Module("Buffer", {
|
||||
finally {
|
||||
div.remove();
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
return parseFloat(DOM(elem).fontSize) / 1.618;
|
||||
}
|
||||
},
|
||||
|
||||
openUploadPrompt: function openUploadPrompt(elem) {
|
||||
|
||||
Reference in New Issue
Block a user