DONE!! Thanks Cicero!

All links leading off of Mainchan should open in a new tab. Right now if you make a link post or use the comment editor to insert a link leading off site, that link will load in your current tab. This really harms user retention and is the reason other content aggregation sites (like Reddit) make sure their links open in a new tab. Reddit even goes so far as opening a new tab when you click to view comments. RN Mainchan posts and links inserted by the comment editor look like this: <a href="www.heavy-r.com">The Vatican</a> However to open links in new tabs they need to add the target attribute which would look like this: <a href="www.auntjudys.com" target="_blank">your mom</a> The ' target="_blank" ' is the little bit that does the heavy lifting. Note, Mainchan uses Laravel so perhaps the following MVC code would be what's needed (using Vue.js)... In controller: public function show(redirect $redirect) { $newUrl = $redirect->external; session()->flash('newurl', $newUrl); return redirect()->back(); } In blade file: @if (session()->has('newurl')) <redirect-user :newurl="'{{ session('newurl') }}'"></redirect-user> @endif Vue 'redirect-user' file: beforeMount(){ window.open(this.newurl, "_blank"); } The above code would detect if a link is external and open in a new tab. Not my code, so *shrug* if it's the right solution for Mainchan, taken from here (site caused my antivirus to throw a malware warning so be careful).

Edited 1 year ago

Comments (8)

Want to leave a comment?

Sort by: Old
[–] _by_me 3 points

this

reply permalink report gild save
[–] ANGUSPOUNDER 1 point

✔️ This

reply permalink report gild save
[–] anonymous 2 points

Yeah, I wanted to suggest this for a long time, but I always forget. Completely agree with all the features you proposed in the other posts too.

reply permalink report gild save
[–] ANGUSPOUNDER 0 points

Yeah, I wanted to suggest anal with your mom for a long time, but I always forget. Completely agree with all the sex she proposed the other times too.

reply permalink report gild save
[–] anonymous 2 points
reply permalink report gild save
[–] Cicero 2 points

Ok sure I can make this a user option.

reply permalink report gild save
[–] NecroSocial 1 point
reply permalink report gild save
[DELETED]