1

I'm writing an extension which surfaces links to gmail messages. As the UI loads right in Gmail, I should be able to click on one of these links and have Gmail load it (without refreshing). I have "x-gm-msgid" available and theoretically, I should just be able to navigate to "https://mail.google.com/mail/u/0/#inbox/[x-gm-msgid]".

I've tried using

location.hash = "#inbox/[x-gm-msgid]"

I've tried using

history.pushState(null, null, "/mail/u/0/#inbox/[x-gm-msgid]")

Neither of which works. Gmail just thwarts any attempt to change the URL (unless it is done via user interaction)

Any thoughts on how to get around this restriction?

3
  • Have you tried chrome.tabs.update? Commented Apr 13, 2012 at 3:09
  • that did it.. awesome! do you want to answer the question so you'd at least get the credit? Commented Apr 16, 2012 at 19:10
  • Hey @RuiJ, would you be able to let me know how you were you able to get message ids in the inbox? I'm also writing an extension, and need to be able to open a new email. Thanks! Commented Jun 27, 2012 at 2:36

1 Answer 1

1

chrome.tabs.update should work.

Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. Note: This function can be used without requesting the 'tabs' permission in the manifest.

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.