vietnam929 Posted January 5, 2010 Posted January 5, 2010 I want to block cookies on some site, but i dont know how. I try to open FFex.au3 and see this function Func _FF_EmptyCookies() _FFCmd('Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager).removeAll();') If Not @error Then Return 1 Return 0 EndFunc ;==>_FF_EmptyCookies Please help me make a function to block and allow cookie on site: Ex: _FF_BlockCookies($site) and _FF_AllowCookies($site)
Stilgar Posted January 5, 2010 Posted January 5, 2010 I want to block cookies on some site, but i dont know how. I try to open FFex.au3 and see this function Func _FF_EmptyCookies() _FFCmd('Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager).removeAll();') If Not @error Then Return 1 Return 0 EndFunc ;==>_FF_EmptyCookies Please help me make a function to block and allow cookie on site: Ex: _FF_BlockCookies($site) and _FF_AllowCookies($site) Depending on the informations there: https://developer.mozilla.org/en/nsICookiePermission you can made something like this: ; $iAccess: ; 0 = ACCESS_DEFAULT ; 1 = ACCESS_ALLOW ; 2 = ACCESS_DENY ; 8 = ACCESS_SESSION Func _FF_CookiesSetAccess($sURL, $iAccess) If __FFCheckURL($sURL) And ($iAccess = 0 Or $iAccess = 1 Or $iAccess = 2 Or $iAccess = 8) Then _FFCmd('Components.classes["@mozilla.org/cookie/permission;1"].getService(Components.interfaces.nsICookiePermission).setAccess(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("' & $sURL & '", null, null),' & $iAccess & ');') If Not @error Then Return 1 EndIf Return SetError(1,0,0) EndFunc ;=============================================================================== Func _FF_CookiesDeny($sURL) Return _FF_CookiesSetAccess($sURL, 2) EndFunc ;=============================================================================== Func _FF_CookiesAllow($sURL) Return _FF_CookiesSetAccess($sURL, 1) EndFunc jEdit4AutoIt PlanMaker_UDF
vietnam929 Posted January 5, 2010 Author Posted January 5, 2010 (edited) thank you so much Edited January 5, 2010 by vietnam929
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now