shellnium icon indicating copy to clipboard operation
shellnium copied to clipboard

Add support to more browsers

Open jontxux opened this issue 2 years ago • 2 comments

Hi, I was thinking we could add support for more browsers. I have tested with Firefox with the following code:

curl -s -X POST -H "Content-Type: application/json" -d '{
  "desiredCapabilities": {
    "browsername":"firefox" 
   }            
}' http://localhost:4444/session | jq

This works good, but the following code returns an error

curl -s -X POST -H "Content-Type: application/json" -d '{
  "desiredCapabilities": {
    "browsername":"firefox",
    "firefoxOptions": {
       "args": [],
     }
   }
}' http://localhost:4444/session | jq

I don't know how it would be for Firefox.

jontxux avatar Dec 09 '21 16:12 jontxux

I am trying the following way, but when executing with the -x flag I see that it adds single quotes and I think that gives error with geckodriver

curl -s -X POST -H '"Content-Type:' 'application/json"' -d '{
    "desiredCapabilities": {
      "browserName":"firefox",
          "moz:firefoxOptions": {
                "args": []
          }
    }
  }' http://localhost:4444/session

get this output

{
  "value": {
    "error": "unknown error",
    "message": "Invalid Content-Type",
    "stacktrace": ""
  }
}

without the single quotation marks works correctly

curl -s -X POST -H "Content-Type: application/json" -d '{
    "desiredCapabilities": {
      "browserName":"firefox",
          "moz:firefoxOptions": {
                "args": []
          }
    }
  }' http://localhost:4444/session 

output

{
  "value": {
    "sessionId": "390ca758-dc2d-4453-a4dd-29c154c6b37c",
    "capabilities": {
      "acceptInsecureCerts": false,
      "browserName": "firefox",
      "browserVersion": "94.0.2",
      "moz:accessibilityChecks": false,
      "moz:buildID": "20211119140621",
      "moz:geckodriverVersion": "0.30.0",
      "moz:headless": false,
      "moz:processID": 10576,
      "moz:profile": "/tmp/rust_mozprofilevZvBgm",
      "moz:shutdownTimeout": 60000,
      "moz:useNonSpecCompliantPointerOrigin": false,
      "moz:webdriverClick": true,
      "pageLoadStrategy": "normal",
      "platformName": "linux",
      "platformVersion": "5.15.0-2-amd64",
      "proxy": {},
      "setWindowRect": true,
      "strictFileInteractability": false,
      "timeouts": {
        "implicit": 0,
        "pageLoad": 300000,
        "script": 30000
      },
      "unhandledPromptBehavior": "dismiss and notify"
    }
  }
}

jontxux avatar Dec 09 '21 21:12 jontxux

@jontxux Thanks your comments! I will check.

Rasukarusan avatar Dec 12 '21 13:12 Rasukarusan