Switch to hasFeature(), which seems perfectly suited for this.
Wed Oct 27 23:48:14 UTC 2010 pix@kepibu.org
* Switch to hasFeature(), which seems perfectly suited for this.
diff -rN -u old-httpauth/form-to-http-auth.js new-httpauth/form-to-http-auth.js
--- old-httpauth/form-to-http-auth.js 2015-04-17 10:03:53.000000000 +0000
+++ new-httpauth/form-to-http-auth.js 2015-04-17 10:03:53.000000000 +0000
@@ -1,7 +1,7 @@
(function () {
function form2httpAuth () {
/* Skip if the browser indicates it does this itself. */
- if (this.className.match(/(\\s|^)natively-supported(\\s|$)/))
+ if (document.implementation.hasFeature("HTTPFormAuth", "1.0"))
return true;
/* Attempt login with provided credentials. */
diff -rN -u old-httpauth/notes.org new-httpauth/notes.org
--- old-httpauth/notes.org 2015-04-17 10:03:53.000000000 +0000
+++ new-httpauth/notes.org 2015-04-17 10:03:53.000000000 +0000
@@ -58,10 +58,8 @@
certainly be doing other things in the JavaScript for those forms, that is not a
viable option.
-Instead, I propose that any browser which supports form-based HTTP Auth should
-add the class 'natively-supported' to forms requesting http authentication.
-This will allow sites to easily detect native support and avoid running their
-own JavaScript-based form-to-http-auth translators.
+Instead, it seems prudent to utilize the DOMImplementation hasFeature function.
+Thus, I propose a feature name of "HTTPFormAuth" and a version of "1.0".
** Logging Out
Forcing logout for users is left to a future version of this specification. See
[tdm] for ideas.