Images in chrome extensions
Images in chrome extensions
mirajsameer
Posts: 2Questions: 0Answers: 0
Hi ,
I am using the dataTable plugin in a chrome extension to beautify some of the table. I am using the zero configuration in initializing the datatable. The only problem I am facing is to load the images. None of the images are displaying in the formatted table, also I am getting the error in the console saying : https://mydomain.salesforce.com/images/sort_asc.png 404 (Not Found).
I have saved the images in the extension folder (/images/image.png) and also I have added all the images in the web_accessible_resources in manifest.json file. Not sure how to get around this issue.
please advise!
I am using the dataTable plugin in a chrome extension to beautify some of the table. I am using the zero configuration in initializing the datatable. The only problem I am facing is to load the images. None of the images are displaying in the formatted table, also I am getting the error in the console saying : https://mydomain.salesforce.com/images/sort_asc.png 404 (Not Found).
I have saved the images in the extension folder (/images/image.png) and also I have added all the images in the web_accessible_resources in manifest.json file. Not sure how to get around this issue.
please advise!
This discussion has been closed.
Replies
Allan
As you already know the datatable css files refer to the images using path ('/images/imageName.png'). Now when I inject datatable's js and css files, these path will actually become https://mydomain.salesforce.com/image/imageName.png, but since in there is no image in the salesforce server an error is shown in the console. But in actuality these images are present in the local extension folder. So in the css files (jquery.dataTables.css) instead of ('../image/imageName.png') I had to specify ('chrome-extension://myExtentionId/images/back_enabled.png') which solves the problem. But it is also mentioned in the the license that we shouldn't change any part of the source code. So I was a little worried.
Anyways,is there any option in the .dataTable() function which will not load any images in the formatted table at all?
I'm looking for either
a) being able to load the images through a specific URL or
b) disabling image loading altogether
@mirajsameer - Your message was October last year - sorry I didn't get a chance to reply at the time! - but just to clarify:
> But it is also mentioned in the the license that we shouldn't change any part of the source code. So I was a little worried.
That is not the case. You are free to modify DataTables however you wish! Just keep my copyright header :-).
> Anyways,is there any option in the .dataTable() function which will not load any images in the formatted table at all?
Sure - just remove them from the CSS. The JS itself makes no reference at all to images, its all in the CSS.
Allan