Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
顯示
檢視
拆分
統一
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
比對精度
智能
語法
無
變更外觀
處理
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
12 年前
差異永不過期
清除
匯出
分享
解釋
2 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
165 行
全部複製
66 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
225 行
全部複製
var gpoFox = {
var gpoFox = {
basePath : "",
basePath : "",
//basePathLocked : "",
//basePathLocked : "",
defaultPath : "",
defaultPath : "",
lockedPath : "",
lockedPath : "",
reg : "",
reg : "",
prefService : "",
prefService : "",
updateDisabled : false,
updateDisabled : false,
//Disable Update button in Help menu
//Disable Update button in Help menu
disableUpdates : function(){
disableUpdates : function(){
if(gpoFox.updateDisabled){
if(gpoFox.updateDisabled){
var name = document.getElementById("checkForUpdates");
var name = document.getElementById("checkForUpdates");
name.disabled = true;
name.disabled = true;
}
}
},
},
//Read value from registry
//Read value from registry
readRegistryValue : function(value){
readRegistryValue : function(value){
switch (gpoFox.reg.getValueType(value)) {
switch (gpoFox.reg.getValueType(value)) {
case gpoFox.reg.TYPE_STRING:
case gpoFox.reg.TYPE_STRING:
return gpoFox.reg.readStringValue(value);
return gpoFox.reg.readStringValue(value);
case gpoFox.reg.TYPE_BINARY:
case gpoFox.reg.TYPE_BINARY:
return gpoFox.reg.readBinaryValue(value);
return gpoFox.reg.readBinaryValue(value);
case gpoFox.reg.TYPE_INT:
case gpoFox.reg.TYPE_INT:
return gpoFox.reg.readIntValue(value);
return gpoFox.reg.readIntValue(value);
case gpoFox.reg.TYPE_INT64:
case gpoFox.reg.TYPE_INT64:
return gpoFox.reg.readInt64Value(value);
return gpoFox.reg.readInt64Value(value);
}
}
// unknown type
// unknown type
return null;
return null;
},
},
//write value to FF preferences
//write value to FF preferences
writePrefValue : function(name,value,locked){
writePrefValue : function(name,value,locked){
if(locked){
if(locked){
return gpoFox.writeLockedPrefValue(name,value);
return gpoFox.writeLockedPrefValue(name,value);
}else{
}else{
return gpoFox.writeUserPrefValue(name,value);
return gpoFox.writeUserPrefValue(name,value);
}
}
return null;
return null;
},
},
//for writing a locked pref
//for writing a locked pref
writeLockedPrefValue : function(name,value){
writeLockedPrefValue : function(name,value){
var prefBranch = gpoFox.prefService.getDefaultBranch(name);
var prefBranch = gpoFox.prefService.getDefaultBranch(name);
switch (prefBranch.getPrefType("")) {
switch (prefBranch.getPrefType("")) {
case prefBranch.PREF_STRING:
case prefBranch.PREF_STRING:
prefBranch.setCharPref("", value);
prefBranch.setCharPref("", value);
prefBranch.lockPref("");
prefBranch.lockPref("");
return true;
return true;
case prefBranch.PREF_INT:
case prefBranch.PREF_INT:
prefBranch.setIntPref("", value);
prefBranch.setIntPref("", value);
prefBranch.lockPref("");
prefBranch.lockPref("");
return true;
return true;
case prefBranch.PREF_BOOL:
case prefBranch.PREF_BOOL:
if(name=="app.update.enabled" && value==false){
if(name=="app.update.enabled" && value==false){
gpoFox.updateDisabled=true;
gpoFox.updateDisabled=true;
}
}
複製
已複製
複製
已複製
if ( value == "false" ){
prefBranch.setBoolPref("",
value
);
prefBranch.setBoolPref("",
false);
}else{
prefBranch.setBoolPref("", true
);
}
prefBranch.lockPref("");
prefBranch.lockPref("");
return true;
return true;
複製
已複製
複製
已複製
default:
switch(gpoFox.getLocalType(value))
{
case "string":
if ( value == "false" ){
prefBranch.setBoolPref("", false);
}else{
prefBranch.setBoolPref("", true);
}
return true;
case "int":
prefBranch.setIntPref("", value);
return true;
case "bool":
prefBranch.setBoolPref("", false);
return true;
default:
return false;
}
}
}
return null;
return null;
},
},
//for writing a user pref
//for writing a user pref
writeUserPrefValue : function(name,value){
writeUserPrefValue : function(name,value){
var prefBranch = gpoFox.prefService.getBranch(name);
var prefBranch = gpoFox.prefService.getBranch(name);
switch (prefBranch.getPrefType("")) {
switch (prefBranch.getPrefType("")) {
case prefBranch.PREF_STRING:
case prefBranch.PREF_STRING:
prefBranch.setCharPref("", value);
prefBranch.setCharPref("", value);
return true;
return true;
case prefBranch.PREF_INT:
case prefBranch.PREF_INT:
prefBranch.setIntPref("", value);
prefBranch.setIntPref("", value);
return true;
return true;
已保存差異
原始文本
開啟檔案
var gpoFox = { basePath : "", //basePathLocked : "", defaultPath : "", lockedPath : "", reg : "", prefService : "", updateDisabled : false, //Disable Update button in Help menu disableUpdates : function(){ if(gpoFox.updateDisabled){ var name = document.getElementById("checkForUpdates"); name.disabled = true; } }, //Read value from registry readRegistryValue : function(value){ switch (gpoFox.reg.getValueType(value)) { case gpoFox.reg.TYPE_STRING: return gpoFox.reg.readStringValue(value); case gpoFox.reg.TYPE_BINARY: return gpoFox.reg.readBinaryValue(value); case gpoFox.reg.TYPE_INT: return gpoFox.reg.readIntValue(value); case gpoFox.reg.TYPE_INT64: return gpoFox.reg.readInt64Value(value); } // unknown type return null; }, //write value to FF preferences writePrefValue : function(name,value,locked){ if(locked){ return gpoFox.writeLockedPrefValue(name,value); }else{ return gpoFox.writeUserPrefValue(name,value); } return null; }, //for writing a locked pref writeLockedPrefValue : function(name,value){ var prefBranch = gpoFox.prefService.getDefaultBranch(name); switch (prefBranch.getPrefType("")) { case prefBranch.PREF_STRING: prefBranch.setCharPref("", value); prefBranch.lockPref(""); return true; case prefBranch.PREF_INT: prefBranch.setIntPref("", value); prefBranch.lockPref(""); return true; case prefBranch.PREF_BOOL: if(name=="app.update.enabled" && value==false){ gpoFox.updateDisabled=true; } prefBranch.setBoolPref("", value); prefBranch.lockPref(""); return true; } return null; }, //for writing a user pref writeUserPrefValue : function(name,value){ var prefBranch = gpoFox.prefService.getBranch(name); switch (prefBranch.getPrefType("")) { case prefBranch.PREF_STRING: prefBranch.setCharPref("", value); return true; case prefBranch.PREF_INT: prefBranch.setIntPref("", value); return true; case prefBranch.PREF_BOOL: prefBranch.setBoolPref("", value); return true; } return null; }, //Set a FF preference //will call setLockPref or setUserPref depending on if locked is set to true or false setPref : function(type,locked){ if(locked){ gpoFox.setLockPref(type); } else{ gpoFox.setUserPref(type); } }, //set a FF locked preference setLockPref : function(type){ gpoFox.reg.open(type,gpoFox.basePath + "\\" + gpoFox.lockedPath,gpoFox.reg.ACCESS_READ); for (var i = 0; i < gpoFox.reg.valueCount; i++) { var prefName = gpoFox.reg.getValueName(i); var FirefoxSetter = gpoFox.readRegistryValue(prefName); gpoFox.writePrefValue(prefName,FirefoxSetter,true); } gpoFox.reg.close(); }, //set a FF user preference setUserPref : function(type){ gpoFox.reg.open(type,gpoFox.basePath + "\\" + gpoFox.defaultPath,gpoFox.reg.ACCESS_READ); for (var i = 0; i < gpoFox.reg.valueCount; i++) { var prefName = gpoFox.reg.getValueName(i); var FirefoxSetter = gpoFox.readRegistryValue(prefName); gpoFox.writePrefValue(prefName,FirefoxSetter,false); } gpoFox.reg.close(); }, //Main function gpofirefox : function(){ try { //set locked preferences from computer GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.lockedPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,true); } //set user preferences from computer GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.defaultPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,false); } //set locked preferences from user GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_CURRENT_USER,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.lockedPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_CURRENT_USER,true); } //set user preferences from user GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_CURRENT_USER,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.defaultPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_CURRENT_USER,false); } }catch(ex){} }, onLoad : function(){ //Define path where to read registry this.basePath = "Software\\Policies"; this.defaultPath = "Mozilla\\defaultPref"; this.lockedPath = "Mozilla\\lockPref"; //load XPCOM component to read registry this.reg = Components.classes["@mozilla.org/windows-registry-key;1"].createInstance(Components.interfaces.nsIWindowsRegKey); //load XPCOM component to read and write preferences this.prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var helpMenu = document.getElementById("menu_HelpPopup"); if (helpMenu) helpMenu.addEventListener("popupshowing", gpoFox.disableUpdates, false); this.gpofirefox(); return; } }; window.addEventListener("load",function(e){gpoFox.onLoad(e);},false);
更改後文本
開啟檔案
var gpoFox = { basePath : "", //basePathLocked : "", defaultPath : "", lockedPath : "", reg : "", prefService : "", updateDisabled : false, //Disable Update button in Help menu disableUpdates : function(){ if(gpoFox.updateDisabled){ var name = document.getElementById("checkForUpdates"); name.disabled = true; } }, //Read value from registry readRegistryValue : function(value){ switch (gpoFox.reg.getValueType(value)) { case gpoFox.reg.TYPE_STRING: return gpoFox.reg.readStringValue(value); case gpoFox.reg.TYPE_BINARY: return gpoFox.reg.readBinaryValue(value); case gpoFox.reg.TYPE_INT: return gpoFox.reg.readIntValue(value); case gpoFox.reg.TYPE_INT64: return gpoFox.reg.readInt64Value(value); } // unknown type return null; }, //write value to FF preferences writePrefValue : function(name,value,locked){ if(locked){ return gpoFox.writeLockedPrefValue(name,value); }else{ return gpoFox.writeUserPrefValue(name,value); } return null; }, //for writing a locked pref writeLockedPrefValue : function(name,value){ var prefBranch = gpoFox.prefService.getDefaultBranch(name); switch (prefBranch.getPrefType("")) { case prefBranch.PREF_STRING: prefBranch.setCharPref("", value); prefBranch.lockPref(""); return true; case prefBranch.PREF_INT: prefBranch.setIntPref("", value); prefBranch.lockPref(""); return true; case prefBranch.PREF_BOOL: if(name=="app.update.enabled" && value==false){ gpoFox.updateDisabled=true; } if ( value == "false" ){ prefBranch.setBoolPref("", false); }else{ prefBranch.setBoolPref("", true); } prefBranch.lockPref(""); return true; default: switch(gpoFox.getLocalType(value)) { case "string": if ( value == "false" ){ prefBranch.setBoolPref("", false); }else{ prefBranch.setBoolPref("", true); } return true; case "int": prefBranch.setIntPref("", value); return true; case "bool": prefBranch.setBoolPref("", false); return true; default: return false; } } return null; }, //for writing a user pref writeUserPrefValue : function(name,value){ var prefBranch = gpoFox.prefService.getBranch(name); switch (prefBranch.getPrefType("")) { case prefBranch.PREF_STRING: prefBranch.setCharPref("", value); return true; case prefBranch.PREF_INT: prefBranch.setIntPref("", value); return true; case prefBranch.PREF_BOOL: if ( value == "false" ){ prefBranch.setBoolPref("", false); }else{ prefBranch.setBoolPref("", true); } return true; default: switch(gpoFox.getLocalType(value)) { case "string": prefBranch.setCharPref("", value); return true; case "int": prefBranch.setIntPref("", value); return true; case "bool": if ( value == "false" ){ prefBranch.setBoolPref("", false); }else{ prefBranch.setBoolPref("", true); } return true; default: return false; } } return null; }, //Set a FF preference //will call setLockPref or setUserPref depending on if locked is set to true or false setPref : function(type,locked){ if(locked){ gpoFox.setLockPref(type); } else{ gpoFox.setUserPref(type); } }, //set a FF locked preference setLockPref : function(type){ gpoFox.reg.open(type,gpoFox.basePath + "\\" + gpoFox.lockedPath,gpoFox.reg.ACCESS_READ); for (var i = 0; i < gpoFox.reg.valueCount; i++) { var prefName = gpoFox.reg.getValueName(i); var FirefoxSetter = gpoFox.readRegistryValue(prefName); gpoFox.writePrefValue(prefName,FirefoxSetter,true); } gpoFox.reg.close(); }, //set a FF user preference setUserPref : function(type){ gpoFox.reg.open(type,gpoFox.basePath + "\\" + gpoFox.defaultPath,gpoFox.reg.ACCESS_READ); for (var i = 0; i < gpoFox.reg.valueCount; i++) { var prefName = gpoFox.reg.getValueName(i); var FirefoxSetter = gpoFox.readRegistryValue(prefName); gpoFox.writePrefValue(prefName,FirefoxSetter,false); } gpoFox.reg.close(); }, getLocalType : function(value){ var returnValue = "string"; if ( value == "true" || value == "false" ){ return "bool" }else{ try{ if (value > -1 ){ return "int" } }catch(ex){} } return returnValue; }, //Main function gpofirefox : function(){ try { //set locked preferences from computer GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.lockedPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,true); } //set user preferences from computer GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.defaultPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_LOCAL_MACHINE,false); } //set locked preferences from user GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_CURRENT_USER,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.lockedPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_CURRENT_USER,true); } //set user preferences from user GPO gpoFox.reg.open(gpoFox.reg.ROOT_KEY_CURRENT_USER,gpoFox.basePath,gpoFox.reg.ACCESS_READ); if(gpoFox.reg.hasChild(gpoFox.defaultPath)){ gpoFox.setPref(gpoFox.reg.ROOT_KEY_CURRENT_USER,false); } }catch(ex){} }, onLoad : function(){ //Define path where to read registry this.basePath = "Software\\Policies"; this.defaultPath = "Mozilla\\defaultPref"; this.lockedPath = "Mozilla\\lockPref"; //load XPCOM component to read registry this.reg = Components.classes["@mozilla.org/windows-registry-key;1"].createInstance(Components.interfaces.nsIWindowsRegKey); //load XPCOM component to read and write preferences this.prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var helpMenu = document.getElementById("menu_HelpPopup"); if (helpMenu) helpMenu.addEventListener("popupshowing", gpoFox.disableUpdates, false); this.gpofirefox(); return; } }; window.addEventListener("load",function(e){gpoFox.onLoad(e);},false);
尋找差異