1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-01 20:22:29 +01:00

Make some attempt to respect "Clear Private Data"

This commit is contained in:
Kris Maglione
2009-09-03 17:29:26 -04:00
parent 9bc7943667
commit b8d972ca94
6 changed files with 82 additions and 15 deletions

View File

@@ -60,7 +60,7 @@ function Browser() //{{{
////////////////////// OPTIONS /////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
options.add(["encoding", "enc"],
options.add(["enc[oding]"],
"Sets the current buffer's character encoding",
"string", "UTF-8",
{
@@ -68,10 +68,13 @@ function Browser() //{{{
getter: function () getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset,
setter: function (val)
{
if (options["encoding"] == val)
return val;
// Stolen from browser.jar/content/browser/browser.js, more or less.
try
{
var docCharset = getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset = val;
getBrowser().docShell.QueryInterface(Ci.nsIDocCharset).charset = val;
PlacesUtils.history.setCharsetForURI(getWebNavigation().currentURI, val);
getWebNavigation().reload(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
}
@@ -269,7 +272,8 @@ function Browser() //{{{
},
{
completer: function (context) completion.url(context),
literal: 0
literal: 0,
privateData: true,
});
commands.add(["redr[aw]"],