0

In my automation I am trying to use the chrome devtools protocol to set the localStorage as I need to set it on a subdomain and not the primary domain. I am able to do this by going to the specific iframe context in the console in dev tools and running localStorage.setItem("key", "value") however when using the devtools protocol I need to specify a contextId for that specific context to be used but I don't know how I would go about finding that Id.

I don't mind how it is accomplished but it needs to be able to be automated and should either return a list of all Ids or should be able to pass in the context name and then return the id

thanks.

Daniel
  • 3
  • 1
  • 2
  • In the protocol, [storage id](https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#type-StorageId) is simply an object like `{securityOrigin: 'https://www.example.com', isLocalStorage: true}` – wOxxOm Jan 29 '21 at 21:43
  • Ahh brilliant that did it. Far simpler approach that I didn't know was possible. i should have read further into the docs. Thanks very much – Daniel Jan 29 '21 at 22:28

0 Answers0