title: Selenium PhantomJS Java - Refused to evaluate a string because 'unsafe-eval' is not an allowed
body: <p>I'm playing with Selenium and PhantomJS. I'm trying to draw all the elements from a web page. When I retrieve some web page and then I try to get the position of any web element I get this error when I select the web element on my code:</p>
  
  <pre><code>org.openqa.selenium.WebDriverException: {"errorMessage":"Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"script-src assets-cdn.github.com\".\n","request":{"headers":{"Accept-Encoding":"gzip,deflate","Cache-Control":"no-cache","Connection":"Keep-Alive","Host":"localhost:26310","User-Agent":"Apache-HttpClient/4.4.1 (Java/1.8.0_45)"},"httpVersion":"1.1","method":"GET","url":"/location","urlParsed":{"anchor":"","query":"","file":"location","directory":"/","path":"/location","relative":"/location","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/location","queryKey":{},"chunks":["location"]},"urlOriginal":"/session/77ee7e10-1077-11e6-9f8f-1f750417371e/element/%3Awdc%3A1462201609875/location"}}
  </code></pre>
  
  <p>My code is the following. I'm using Jsoup to get the elements because with selenium I often got the same error as previously mentioned:</p>
  
  <pre><code>    WebDriver driver = new PhantomJSDriver();
      driver.manage().window().setSize(new Dimension(1366, 768));
      driver.get(URL);
      Document doc = Jsoup.parse(driver.getPageSource());
      Elements e1 = doc.body().getAllElements();
      ArrayList&lt;String&gt; tags = new ArrayList&lt;&gt;();
      for (Element e : e1) {
          if (tags.indexOf(e.tagName()) == -1) {
              tags.add(e.tagName());
              List&lt;WebElement&gt; query = null;
              if (driver.findElements(By.tagName(e.tagName())).size() &lt; 1) {
                  continue;
              }
              try {
                  query = driver.findElements(By.tagName(e.tagName()));
              } catch (Exception ex) {
                  continue;
              }
              for (WebElement temp1 : query) {
                  try {
                      Point po = temp1.getLocation();
                      Dimension d = temp1.getSize();
                      if (d.width &lt;= 0 || d.height &lt;= 0 || po.x &lt; 0 || po.y &lt; 0) {
                          continue;
                      }
                      graph.draw(new Rectangle(po.x, po.y, d.width, d.height));
                  } catch (WebDriverException ex) {
                      System.out.println("Error!");
                      ex.printStackTrace();
                  }
              }
          }
      }
  </code></pre>
  
  <p>Why I can't get the position from an element?
  <br>
  I'm using selenium 2.46, PhantomJS 2.0.0 and, for example, this page have problems <a href="https://github.com/ariya/phantomjs/issues/13114" rel="noreferrer">https://github.com/ariya/phantomjs/issues/13114</a></p>