0

I'm trying to output some very detailed summary information about the properties of nodes in the DOM tree. Several years ago, I wrote a browser extension that created a new window and wrote the output there; that extension is no longer compatible with modern versions of Firefox, so I'm trying to port it into a Greasemonkey script instead of writing a whole new extension. Unfortunately, the cross-origin scripting policy seems to prevent me from actually writing anything to the window I've created. I have two questions: 1. Is there a better way to output too much text for an alert box, so that some or all can be copied, without modifying the original page's DOM tree? 2. If not, how do I create a window and output text to it from a Greasemonkey script?

I'm running the current version of Greasemonkey, by the way.

1 Answers1

0
  1. Is there a better way to output too much text for an alert box, so that some or all can be copied, without modifying the original page's DOM tree?

You can use shadow DOM to create a popup box that is isolated from the original CSS & JS.

  1. If not, how do I create a window and output text to it from a Greasemonkey script?

AFA user-scripts, a new window is a new page. It will be a lot more work if you need to pass data to that window from a user-script. Therefore option 1 would be recommended.

erosman
  • 7,094
  • 7
  • 27
  • 46