PhotoSwipe icon indicating copy to clipboard operation
PhotoSwipe copied to clipboard

Question: Is it possible to change Referer which PhotoSwipe sends to host when loading images?

Open sullivan-2 opened this issue 2 years ago • 1 comments

Is it possible by modifying app code to manually set Referrer which PhotoSwipe sends in request headers to host when downloading images?

I don't know JavaScript well, but could try finding solution if you advise the place in PhotoSwipe code where images downloading maintained.

sullivan-2 avatar Mar 15 '23 22:03 sullivan-2

You may use contentLoadImage event.

lightbox.on('contentLoadImage', ({ content, isLazy }) => {
  console.log(content.element);
});

If you wanna look how it works internally, the code is at https://github.com/dimsemenov/PhotoSwipe/blob/beb4810b17e90b8b01a8331974b4c66169cd23a5/src/js/slide/content.js#L121

dimsemenov avatar Mar 16 '23 06:03 dimsemenov