1

I'm trying to build a Google Chrome extension that would insert some contextual information to the user under every e-mail. I'm basically trying to create something similar to a gmail contextual gadget, but for hotmail. I plan to achieve that by extracting and injecting HTML in the page via the Chrome extension.

However, I'm having problems reaching the message body DOM nodes with javascript. Is this because they use iframes? If so, how would I do it?

Marjan
  • 1,378
  • 1
  • 14
  • 21
  • They do not seem to use iframes. However, with Inspect Element, it appears that the body element is a `div` with an ID of `mp0_msgPartBody`. I think it can be rather straight-forward to get the contents of that div if you know the ID. – pimvdb Oct 04 '11 at 13:15
  • Actually they do use an iframe. It has an id of "appFrame" if you search for it. And I believe that's the problem. The div with that ID is within that iframe, so I can't reach it from the parent document. Running this in the console returns null: document.getElementById("mp0_msgPartBody") – Marjan Oct 04 '11 at 13:38
  • That iframe is not used for me. I guess I can't really help further, but I would advise supporting different cases - apparently, it isn't an iframe for everybody. – pimvdb Oct 04 '11 at 14:04

1 Answers1

0

You could try xpath to read the div?

MissCoder87
  • 2,669
  • 10
  • 47
  • 82
  • I tried to, but it doesn't let me. The main content of the page is in an iframe, and I seem to be unable to access anything within it with xPath. – Marjan Oct 04 '11 at 13:33
  • If you change the url it gives you: http://co103w.col103.mail.live.com/default.aspx#!/mail/InboxLight.aspx?n=413270862 take out the default.aspx#!/ bit it seems to not be in a frame. Any help? – MissCoder87 Oct 04 '11 at 13:42