A Flarum extension which adds a new BBcode called preview. This allows you to post a link with a maginifying glass icon to the right of the link. Hover over or tap on the magnifying glass icon and a preview will load via an iframe. Some websites will not load in iframes; they don't allow it. If you run into this, the preview simply will not load and you will see a browser error. This is your signal to edit your post and remove the preview BBcode. Better luck next time. 😉 And now, the screenshots:
Before hovering (or tapping) on the magnifying glass:
After hovering (or tapping) on the magnifying glass:
Here is the BBcode (preview equals the URL):
composer require zerosonesfun/flarum-ext-link-previews
composer update zerosonesfun/flarum-ext-link-previews
php flarum cache:clear
Also, after updating, deactivate and then reactivate the extension. Go to your admin dashboard, click tools, and click clear cache. And, clear your browser cache too.
Known issue, if you want to call it an issue: You will notice that this purposely adds height to your post (some blank vertical space). This is because, if someone posts a link only (just one or two lines) then the preview was being cut off. No amount of CSS z-index or various positioning rules was fixing it for me. But, of course anyone is welcome to help me figure this out and contribute to this extension via github.
An extension by Billy Wilcosky.