Delete Single Cookie

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
Post Reply
Gazoo432
Posts: 1
Joined: Fri Nov 23, 2018 2:45 pm

Delete Single Cookie

Post by Gazoo432 » Fri Nov 23, 2018 2:56 pm

I am trying to write a macro for some UI testing and need to be able to clear a single site cookie, the CLEAR method of course will do the trick in a very messy way unless I am running Firefox but I need to test across multiple browsers. So without backing up all Chrome cookies then deleting all and running the macro is there a way to delete a single site cookie for Chrome?

Chrome: 70.0.3538.102
OS: Mac OSX 10.14.1
iMacro: 10.0.5
chivracq
Posts: 7895
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Delete Single Cookie

Post by chivracq » Fri Nov 23, 2018 3:50 pm

Gazoo432 wrote:I am trying to write a macro for some UI testing and need to be able to clear a single site cookie, the CLEAR method of course will do the trick in a very messy way unless I am running Firefox but I need to test across multiple browsers. So without backing up all Chrome cookies then deleting all and running the macro is there a way to delete a single site cookie for Chrome?

Code: Select all

Chrome: 70.0.3538.102 
OS: Mac OSX 10.14.1
iMacro: 10.0.5
Oh, yep indeed, you are right, the 'Domain' Parameter for the 'CLEAR' Command is only supported on v10.0.2 for FF, I thought it was supported on v10.0.x for CR as well, but nope...!

Oh well then, pfff..., dunno...! Some "Idea" to investigate then maybe, is to inspire yourself from the following Syntax which works in FF using a '.js' Script to launch a local '.EXE' or '.BAT' File (I think I had tested in v8.8.2 and/or v8.9.7 for FF), manage to convert it to use with 'URL GOTO=javascript:', and delete your Cookie from a '.BAT' File or PowerShell Script or Equivalent on MacOS... :idea:

Code: Select all

//'Open Local File from JS:
var file = Components.classes["@mozilla.org/file/local;1"] 
                 .createInstance(Components.interfaces.nsILocalFile); 
file.initWithPath("C:\\_abc\\myfile.bat"); 
file.launch();
Example for PowerShell Script:
- Powershell Script to delete specific cookie

+ You could have a look at the v10.0.2 for FF Add-on to "inspect" how that Functionality per Domain has been implemented in the Code...

Several Threads on SOF about deleting a Single Cookie from JS... (To use also with 'URL GOTO=javascript:'...)

Most Settings and Config Pages on CR are html/xml Pages I think, that can be loaded in the Browser directly from their URL and can maybe be automated also directly from iMacros... (iMacros for FF has "Difficulties" with such Pages, and requires Trick on Trick on Workaround to manage to do anything from a Script, maybe it works a bit better on CR...?)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply