phantomjs icon indicating copy to clipboard operation
phantomjs copied to clipboard

<link> with empty href="" re-requests same page

Open seriallos opened this issue 12 years ago • 1 comments

HTML like the following causes Phantom to request the initial page twice - this does not appear to happen in Chrome or other browsers.

HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Test Page</title>
    <link href="" media="screen" rel="stylesheet" type="text/css" >
  </head>
  <body>
    Hello!
  </body>
</html>

Test script (empty.coffee):

page = require('webpage').create()

page.onResourceRequested = ( req ) ->
  console.log "Requested: #{req.method} #{req.url}"

page.onResourceReceived = ( res ) ->
  if res.stage == 'end'
    console.log "Receieved: #{res.status} #{res.contentType} #{res.url}"

page.open 'http://example.com/empty.html', ->
  phantom.exit()

CLI output:

$ phantomjs empty.coffee
Requested: GET http://example.com/empty.html
Receieved: 200 text/html http://example.com/empty.html
Requested: GET http://example.com/empty.html
Receieved: 200 text/html http://example.com/empty.html

seriallos avatar Jan 20 '14 21:01 seriallos

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

stale[bot] avatar Dec 30 '19 17:12 stale[bot]