queryCommandIndeterm() is not supported by Opera
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 23 Jun 2011 14:47:37 -0600
changeset 317 067950bfb8f5
parent 316 503076bbf557
child 318 6bbae37e774b
queryCommandIndeterm() is not supported by Opera
extramethods.html
--- a/extramethods.html	Thu Jun 23 14:43:44 2011 -0600
+++ b/extramethods.html	Thu Jun 23 14:47:37 2011 -0600
@@ -162,21 +162,25 @@
 	var browserCell = document.createElement("td");
 	tr.appendChild(browserCell);
 
-	var browserResult;
-	try {
-		setSelection(points[0], points[1], points[2], points[3]);
-		browserResult = browserFn.call(document, command);
-	} catch (e) {
-		browserCell.textContent = "Exception: " + e;
-		if (typeof e == "object" && "stack" in e) {
-			browserCell.textContent += " (stack: " + e.stack + ")";
+	if (typeof browserFn == "undefined") {
+		browserCell.textContent = "Method undefined";
+	} else {
+		var browserResult;
+		try {
+			setSelection(points[0], points[1], points[2], points[3]);
+			browserResult = browserFn.call(document, command);
+		} catch (e) {
+			browserCell.textContent = "Exception: " + e;
+			if (typeof e == "object" && "stack" in e) {
+				browserCell.textContent += " (stack: " + e.stack + ")";
+			}
 		}
-	}
 
-	getSelection().removeAllRanges();
+		getSelection().removeAllRanges();
 
-	if (typeof browserResult != "undefined") {
-		browserCell.textContent = typeof browserResult + ' "' + browserResult + '"';
+		if (typeof browserResult != "undefined") {
+			browserCell.textContent = typeof browserResult + ' "' + browserResult + '"';
+		}
 	}