Next.js Discord

Discord Forum

Open picture in the new tab

Answered
Thai posted this in #help-forum
Open in Discord
Avatar
ThaiOP
I upload file image and then want to preview this pic in the new tab. I can go the new tab but I see about:blank not my url file. I must refresh page or enter url to see picture. If I don't click to refresh is can't to see preview picture.

this is my code
<a
href={file.URL}
target="_blank"
rel="noopener noreferrer"
className="cursor-pointer text-red-500"
>
Preview
</a>
Image
Answered by Risky did start the fire 🙃
i know that this may not be the nicest solution but can you try this: https://ourcodeworld.com/articles/read/682/what-does-the-not-allowed-to-navigate-top-frame-to-data-url-javascript-exception-means-in-google-chrome (it makes a new window instead of new tab) - and it seems like it doesn't work for security
View full answer

2 Replies

Avatar
Risky did start the fire 🙃
i know that this may not be the nicest solution but can you try this: https://ourcodeworld.com/articles/read/682/what-does-the-not-allowed-to-navigate-top-frame-to-data-url-javascript-exception-means-in-google-chrome (it makes a new window instead of new tab) - and it seems like it doesn't work for security
Answer
Avatar
ThaiOP
thank you