Please see my comment to the question.
Now, even if the following is not an answer, it would be a good food for thought:
myWindow =
myPageContent = myWindow.document; :-)
myCurrentPageContent = document; :-)
Perhaps you need something different. Too bad you did not really explain what you are trying to achieve. Then please clarify, but first, think at this simple code fragment. :-)
—SA