简体   繁体   中英

crossrider extension won't load on https websites

I'm using crossrider to make a cross-browser extension for my website.

Here's my Page Code (extension.js) :

 appAPI.ready(function($) { //alert("Hello World"); appAPI.resources.createImage( '<a href="test.html"><img src="http://localhost/images/fleche.png" width="128" height="128" /></a>' ).prependTo('body'); }); 

The snippet is only working with website using the http protocol. When it comes to https, the javascript code doesn't run.

Thank you for your help.

The appAPI.resources.createImage method is designed for creating a jQuery image object using a file from the resources folder as the src. As the note in the docs say:

You must prefix the src attribute with resource-image://

If you want to simply inject an image into a page, use standard jQuery. eg:

$('<a href="test.html"><img src="http://localhost/images/fleche.png" width="128" height="128" /></a>')
  .prependTo('body');

[ Disclosure : I am a Crossrider employee]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM