Markup: Github flavoured markdown doesn't support Javascript links. (for bookmarklets)

Created on 23 Sep 2011  路  16Comments  路  Source: github/markup

I have a readme that I want to have a link for a bookmarklet to in. The link starts with javascript:.....

Due to this, github doesn't render the link, and instead renders it as a link to github.com

Edit (6 years later)

I under-estimated the difficulty of using github pages. You should probably use that.

Most helpful comment

For security reasons, we don't allow user-controlled scripts to run on GitHub.com, and this is one example of that. (A malicious user could steal your GitHub cookies or access other open GitHub tabs with possibly confidential information, due to the same-origin policy.)

All 16 comments

Just encountered this as well. Tried escaping all brackets in the link, and the page is rendered correctly visually, but there is no "href" attribute given to the A tag.

+1

+1

Still needed
+1

+1

+1, Please

I was thinking about it - this is done to prevent sneaky XSS includes in Github. I'm going to close this issue.

+1
even if it's a xss prevention mechanism, it's up to the user to know if should click on a javascript link

+1
Just show some visual warning next to it, some icon or something similar.

Has anyone found an alternative to sharing bookmarklets in a github wiki?

+1

馃槥

Maybe we will have some day this feature?

For security reasons, we don't allow user-controlled scripts to run on GitHub.com, and this is one example of that. (A malicious user could steal your GitHub cookies or access other open GitHub tabs with possibly confidential information, due to the same-origin policy.)

This issue makes it impossible to offer OpenSearch plug-ins on github wiki pages. Firefox supports two methods for a web page to offer an OpenSearch plug-in: auto-discovery by placing a link rel in the head element, or a link that invokes a javascript method.

https://developer.mozilla.org/en-US/Add-ons/Creating_OpenSearch_plugins_for_Firefox#Autodiscovery_of_search_plugins

https://developer.mozilla.org/en-US/docs/Web/API/Window/sidebar/Adding_search_engines_from_Web_pages

Neither of these looks possible in github wiki pages -- the head element doesn't appear customizable at all, and user-controlled javascript is disabled for security reasons (= this report).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zoffixznet picture zoffixznet  路  6Comments

davidmoten picture davidmoten  路  5Comments

jpluimers picture jpluimers  路  5Comments

Istiakmorsalin picture Istiakmorsalin  路  4Comments

doggy8088 picture doggy8088  路  4Comments