News for hackers. Stuff that matters.
Re:It's always been you, Canvas2D by tentacleuno on Friday March 04, 2022 @12:07PM (#30557387)
Your trick doesn't work for me in Firefox 96 :)

One more: If you set an image's src attribute to the same thing, it'll still reload the image.

  const image = new Image("/img.png");
  document.body.append(image);
  image.src = image.src;
Re:It's always been you, Canvas2D by greggman3 on Friday March 04, 2022 @12:42PM (#30557849)
It might not actually reload the image but it has to fire all the events as though it did otherwise code would hang.
Re:It's always been you, Canvas2D by tentacleuno on Friday March 04, 2022 @06:34PM (#30562064)
It does reload the image in Firefox at least. I just tried it.
Re:It's always been you, Canvas2D by MatmaRex on Saturday March 05, 2022 @07:57AM (#30567141)
Oh, it works, it's just cheekier than you think - it won't refresh the page if the URL includes a hash/fragment (such as after you clicked one of the "next" links while browsing comments here).