mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-05 05:45:48 +01:00
Call the Sanitize autocommand when clearing each private item.
--HG-- extra : transplant_source : a%AB%B2%02%28R%3EM%E5%AC%7C%CB%18%2A%AA9%FEbt%09
This commit is contained in:
@@ -253,6 +253,21 @@ function Sanitizer() //{{{
|
||||
}
|
||||
});
|
||||
|
||||
// call Sanitize autocommand
|
||||
for (let [name, item] in Iterator(self.items))
|
||||
{
|
||||
let arg = prefToArg(name);
|
||||
|
||||
if (item.clear)
|
||||
{
|
||||
let func = item.clear;
|
||||
item.clear = function () {
|
||||
autocommands.trigger("Sanitize", { name: arg })
|
||||
func.call(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.getClearRange = Sanitizer.getClearRange;
|
||||
|
||||
// Largely ripped from from browser/base/content/sanitize.js so we can override
|
||||
|
||||
@@ -58,6 +58,7 @@ const config = { //{{{
|
||||
["PageLoadPre", "Triggered after a page load is initiated"],
|
||||
["PageLoad", "Triggered when a page gets (re)loaded/opened"],
|
||||
["PrivateMode", "Triggered when private mode is activated or deactivated"],
|
||||
["Sanitize", "Triggered when a sanitizeable item is cleared"],
|
||||
["ShellCmdPost", "Triggered after executing a shell command with :!cmd"],
|
||||
["VimperatorEnter", "Triggered after Firefox starts"],
|
||||
["VimperatorLeavePre", "Triggered before exiting Firefox, just before destroying each module"],
|
||||
|
||||
@@ -58,7 +58,7 @@ The following keywords are available where relevant:
|
||||
|*<size>* |The size of a downloaded file. Only for *DownloadPost*.
|
||||
|*<file>* |The target destination of a download. Only for *DownloadPost*.
|
||||
|*<state>* |The new state. Only for *Fullscreen* and *PrivateMode*.
|
||||
|*<name>* |The color scheme name. Only for *ColorScheme*.
|
||||
|*<name>* |The name of the item. Only for *ColorScheme* and *Sanitize*.
|
||||
|===============================================================================
|
||||
|
||||
________________________________________________________________________________
|
||||
|
||||
Reference in New Issue
Block a user