Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a copy of MathJax #4

Open
pkra opened this issue Aug 18, 2013 · 4 comments
Open

Adding a copy of MathJax #4

pkra opened this issue Aug 18, 2013 · 4 comments

Comments

@pkra
Copy link
Contributor

pkra commented Aug 18, 2013

I've tried to add a (slim) copy of MathJax, but I don't understand chrome extensions well enough to make it work.

There's a branch in my fork at https://github.com/pkra/wiki-mathjax/tree/add_mathjax which contains a copy (as well as the right configuration from Wikipedia). I tried to follow http://developer.chrome.com/extensions/manifest/web_accessible_resources.html (and temporarily hard-coded the extension ID). Still, Chrome complains that MathJax.js is not in the manifest. Perhaps you have an idea.

@bgromov
Copy link
Owner

bgromov commented Aug 18, 2013

Peter, thanks for tackling this problem. I've tried it myself few days ago, without success though. However with the help of your code it finally works.

The only issue is that web_accessible_resources should be _outside_ of content_scripts section in manifest.json. Also wildcards are allowed for it, so adding

"web_accessible_resources": ["mathjax/*"],

is sufficient to make everything work.

PS. This extension is my very first experience actually, so it took me quite some time to find the problem.

@bgromov
Copy link
Owner

bgromov commented Aug 18, 2013

There is also a convenience function chrome.extension.getURL() to convert relative extension paths. So instead of hardcoding the extension's ID into URL, we can use something like

chrome.extension.getURL('mathjax/MathJax.js?config=TeX-AMS_HTML')

@pkra
Copy link
Contributor Author

pkra commented Aug 19, 2013

Ah! That's what I missed! Great -- looking forward to giving it another go.

@pkra
Copy link
Contributor Author

pkra commented Aug 30, 2013

I've just realized that we'll need to workaround MathJax#256. I'll check with the devs if we can provide a patch for chrome extensions.

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

No branches or pull requests

2 participants