phantomjs
phantomjs copied to clipboard
<link> with empty href="" re-requests same page
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
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!