Include links to images in page as images

Latest Version

Version
1.3
Update
August 29, 2017
Size
9.5KiB
Developer
Category
Users
211
Rating
4.875 ★
Manifest Version
2
Web Store Status
Languages Support
English
See more
Permissions
See more

Inline Mantis Images Extension

Inline Mantis Images

The Mantis system attaches file as
http://*/mantis/file_download.php?file_id=55882&type=bug
with a name \"xyz.gif\"

This extension inlines the attached images to see them directly and need not to click on each image.

Your URL needs to match
\"http://*/*\"
or
\"\"

Version History:
1.2: Match all_urls (as our system changed to from http://.../mantis to http://mantis.domain.com/
1.1: Detect images case insensitive.

Here is the JavaScript source:
for ( var i = 0; i < document.links.length; ++i) {
\tmyHref = document.links[i].href;

\tlinkText = document.links[i].firstChild.data;
\tif (linkText != null) {
\t\tlinkText = linkText.toLowerCase();
\t\tif (linkText.indexOf(\".gif\") >= 0 || linkText.indexOf(\".png\") >= 0
\t\t\t\t|| linkText.indexOf(\".jpeg\") >= 0
\t\t\t\t|| linkText.indexOf(\".jpg\") >= 0
\t\t\t\t|| linkText.indexOf(\".bmp\") >= 0)

\t\t{
\t\t\tvar myIMG = document.createElement(\"img\");
\t\t\tmyIMG.src = document.links[i].href;
\t\t\tmyIMG.alt = linkText;
\t\t\tmyIMG.title = linkText;
\t\t\tdocument.links[i].appendChild(document.createElement(\"br\"));
\t\t\tdocument.links[i].appendChild(myIMG);
\t\t\tdocument.links[i].appendChild(document.createElement(\"br\"));
\t\t}
\t}
}
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx","manifest_version": 2,"name": "Inline Mantis Images","version": "1.3","description": "Include links to images in page as images","icons": {"48": "icon48.png","128": "icon128.png"},"author": "Stefan Cordes","content_scripts": [{"matches": ["http://*/*",""],"js": ["inlineImages.js"],"run_at": "document_end"}],"homepage_url":"https://github.com/rscadrde/inline-mantis-images"}
Read more

Similar Extensions

User reviews

icon

Amaury Guimarães (MeninoBambinoGaroto) (ID: 000000dacae41b17) Voted 5 ★ - Updated 06/05/2022 Works exactly how I hoped it would. Perfect!

icon

Arkadiusz Dąbkowski (ID: 0000004dce6e9498) Voted 5 ★ - Updated 03/02/2013 OK.

icon

(ID: ) Voted 5 ★ - Updated 12/17/2012 this is awesome! (tooo jeeeszt boszkiee!)