C:\fakepath\

The things one finds while reading the specs:

For historical reasons, the value IDL attribute prefixes the filename with the string "C:\fakepath\". Some legacy user agents actually included the full path (which was a security vulnerability). As a result of this, obtaining the filename from the value IDL attribute in a backwards-compatible way is non-trivial. The following function extracts the filename in a suitably compatible manner:


function extractFilename(path) {
  if (path.substr(0, 12) == "C:\\fakepath\\")
    return path.substr(12); // modern browser
  var x;
  x = path.lastIndexOf('/');
  if (x >= 0) // Unix-based path
    return path.substr(x+1);
  x = path.lastIndexOf('\\');
  if (x >= 0) // Windows-based path
    return path.substr(x+1);
  return path; // just the filename
}

(source, please look at the URL)

WHAT We Guck!!?

At the same time, Firefox seems to be interpreting the title of this post literally, and instead of C:\fakepath\, I see C:akepath in the tab title--because it is showing the escaped f (i.e. \f). A nifty square with (0 0 0 C) shows in the browser window title area instead of the \f...

Update, later: Chrome does it too, as well as Chromium, and Opera.

Another update: maybe it's a WordPress thing? I just wrote a test html file with backslash on its title and it's shown properly on the tab title. Hum ho.

Glitches, glitches--they are everywhere!