0

I'm trying to read XML content from window.open into a string variable s like this via a bookmarklet:

javascript: (function() { s=window.open('https://supportcenter.checkpoint.com/supportcenter/secureKnowledgeRss'); s=s.document; alert(s); })();

However, alert just shows '[object HTMLDocument]' instead of the real XML content. Alternatively, is there any way to change the doctype of window.open to HTML in order to show the XML data as simple plain text?

I also tried this code:

javascript: (function() { s=window.open('https://supportcenter.checkpoint.com/supportcenter/secureKnowledgeRss'); var xml = new XMLSerializer(); var str = xml.serializeToString(s.document);; alert(str); })();

but it just returns:

<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>
4

1 Answer 1

0

A live example here

Due to CORS limitation this bookmarklet only works if your current page is https://supportcenter.checkpoint.com/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.