wirepair / gcd

Unofficial implementation of the Google Chrome Remote Debugger in Go
MIT License
186 stars 31 forks source link

Fixes GetDOMStorageItemsWithParams with correct response type #72

Closed bohrium272 closed 8 months ago

bohrium272 commented 9 months ago

GCD response for GetDOMStorageItems with a 2D array [[key1, value1], [key2, value2]]. This PR changes the type of Entries to [][]string to properly parse this response.

Example:

{
    "command":"DOMStorage.getDOMStorageItems",
    "parameters":{"storageId":{"isLocalStorage":false,"securityOrigin":"https://www.amazon.in"}}
}
{
    "entries": [
        [
            "eelsts",
            "scs"
        ],
        [
            "csmtid",
            "value"
        ],
        [
            "JGKC80APHCXPRJ30YCYC",
            "1"
        ],
        [
            "CSM_previousURL",
            "https://www.amazon.in/"
        ]
    ]
}
camswords commented 9 months ago

@bohrium272, the file changed will be overwritten after ./v2/gcdapigen/build.sh is run. This command regenerates the gcdapi folder based on the downloaded protocol.json file.

getDOMStorageItems in the protocol.json looks correct, it returns an array where each element is an Item. An Item is an array of strings. It seems the gcdapigen.go isn't creating the correct return type given this information.

camswords commented 8 months ago

Closing in preference to https://github.com/wirepair/gcd/pull/74.