Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

setContent + non-self-closed script tag = parsing terminates #11323

Closed
bblack opened this issue May 15, 2013 · 1 comment
Closed

setContent + non-self-closed script tag = parsing terminates #11323

bblack opened this issue May 15, 2013 · 1 comment
Labels

Comments

@bblack
Copy link

bblack commented May 15, 2013

PhantomJS decides to close up all of the elements following the first non-self-closed script tag it encounters (i.e. <script .. />). Using the prepackaged mac binary, v1.9, I get the following:

Script:

var page = require('webpage').create();
var content = "<html><head><script src='http://localhost/dashboard.js'></script><script></script></head><body>this is a test</body></html>"
page.setContent(content, "http://localhost/");
console.log(page.content);

Output:

<html><head><script src="http://localhost/dashboard.js"></script></head></html>

If I change any one of the following, it seems to work:

  • do a page.open() instead of page.setContent()
  • self-close the tag (change it to <script />)
@stale stale bot added the stale label Dec 27, 2019
@stale
Copy link

stale bot commented Dec 30, 2019

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 stale bot closed this as completed Dec 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant