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 10 months ago

Comments (8)

Want to leave a comment?

Sort by: Top
3
_by_me

this

reply permalink report gild save
1
ANGUSPOUNDER

✔️ This

reply permalink report gild save
2
anonymous

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
0
ANGUSPOUNDER

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
2
anonymous
reply permalink report gild save
2
Cicero

Ok sure I can make this a user option.

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