
$pref_Objects="permissions.default.object";
$pref_DomStorage="dom.storage.enabled";

pref_ToggleObjects{
macroinfo=_("Toggle object loading");
menuchecked=(getpref(INT,$pref_Objects)==2);
togglepref(INT,$pref_Objects,1,2); &_pref_SyncButtons2;
statusbar(sub("%s",getpref(INT,$pref_Objects)==2?$off:$on,_("Object loading %s")));
}
pref_ToggleDomStorage{
macroinfo=_("Toggle DomStorage-supercookies");
menuchecked=!getpref(BOOL,$pref_DomStorage);
togglepref(BOOL,$pref_DomStorage); &_pref_SyncButtons2;
statusbar(sub("%s",!getpref(BOOL,$pref_DomStorage)?$off:$on,_("DomStorage support %s")));
}

# ----PRIVATE

# Menu Integration
_pref_BuildMenu2{
setmenu(_Privacy_Settings,macro,"Block &Objects",pref_ToggleObjects);
setmenu(_Privacy_Settings,macro,"Block DOM SuperCookies",pref_ToggleDomStorage);
}
$OnInit=$OnInit."_pref_BuildMenu2;";

# Toolbar Integration
_pref_SyncButtons2{
pluginmsg(toolbars,"CheckButton","&Privacy Bar,macros(pref_ToggleObjects),".(getpref(INT,$pref_Objects)==2?1:0));
#pluginmsg(toolbars,"CheckButton","&Privacy Bar,macros(pref_ToggleDomStorage),".(getpref(BOOL,$pref_DomStorage)?0:1));
}
_pref_BulidToolbar{
$info =_("Block Flash Objects");
$info1 =_("Block Flash Coockes");
pluginmsg(toolbars,"AddButton","&Privacy Bar,Flash OnOff,macros(pref_ToggleObjects),,".$info.",64,13,Flash.bmp[1],Flash.bmp[0],","");
#pluginmsg(toolbars,"AddButton","&Privacy Bar,Storage OnOff,macros(pref_ToggleDomStorage),,".$info1.",64,13,Flash.bmp[3],Flash.bmp[2],","");
}


$OnSetup=$OnSetup."_pref_BulidToolbar;";
$OnLoad=$OnLoad."_pref_SyncButtons2;";
$OnStartup=$OnStartup."_pref_SyncButtons2;";