Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Custom JS extension - getting started #3

Open
jakubmikita opened this issue Dec 2, 2016 · 1 comment
Open

Custom JS extension - getting started #3

jakubmikita opened this issue Dec 2, 2016 · 1 comment

Comments

@jakubmikita
Copy link

jakubmikita commented Dec 2, 2016

Hi,

Can you give me any hint where to get started with developing own custom JS script?

I tried to search for any object into which I can hook in but no luck... is there such object available in the scope? Maybe even something like InboxSDK but I cannot find it? :)

I suffer because Inbox cannot handle the signatures for SMTP account and I wanted to automatically apply email template based on the email address.

@Thomas101
Copy link
Member

Hi, when you add the userscript it gets added into the head of the gmail/inbox window - usually before page load is complete.

You should be able to access window, document and any global variables added in by Gmail and Inbox. If you want to debug what's going on, you can right click on your account icon and choose inspect. This will bring up the inspector for that individual mailbox, in the same way chrome brings up the inspector for a window.

If you want to add something like InboxSDK you could inject the script with a script tag...

var el = document.createElement('script')
el.src = 'https://myurl.com/inboxsdk.js'
document.head.appendChild(el)

Let me know if you need any more help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants