1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 14:34:11 +01:00

Do something remotely reasonable where designMode documents are concerned. Some fixes for evalInSandbox problems in recent nightlies.

This commit is contained in:
Kris Maglione
2010-10-24 20:21:14 -04:00
parent 6f95b33694
commit dc38a2208c
8 changed files with 86 additions and 76 deletions

View File

@@ -262,7 +262,7 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
dequote: function dequote(pattern, chars)
pattern.replace(/\\(.)/, function (m0, m1) chars.indexOf(m1) >= 0 ? m1 : m0),
domToString: function (node) {
domToString: function (node, html) {
if (node instanceof Ci.nsISelection && node.isCollapsed)
return "";
@@ -282,6 +282,8 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
let str = services.create("string");
str.data = encoder.encodeToString();
if (html)
return str.data;
let [result, length] = [{}, {}];
services.create("htmlConverter").convert("text/html", str, str.data.length*2, "text/unicode", result, length);