Search the plugin when moving out of the website
#1
I want to search for a plugin when clicking on a link outside the site will display a message indicating whether the user specified exits the link from the site.
Reply
#2
What you want is a endpoint of a REST API, there is an unofficial plugin(https://github.com/mohamedbenjelloun/MyB...API-System), you can try this.

or for your requirements, ask someone to code just one endpoint for you.
Reply
#3
I guess OP needs a friendly redirect like simple warning page that he is gonna leave the site following an external link.
This can be easily done with few lines of jQuery.
[Image: logo.svg.svg]
Reply
#4
(05-06-2019, 10:25 AM)effone Wrote: I guess OP needs a friendly redirect like simple warning page that he is gonna leave the site following an external link.
This can be easily done with few lines of jQuery.

The jquery may be a little bit harder to do because all url are parsed on the same way, with a rel="noopener" and target="_blank", even if they are internal (link to another forum page). So, you can add a listener like $("a[rel='noopener']").click() but you'll have to parse the attr('href') value and compare it to the bburl before display (or not) the notice.
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
#5
The approach is absolutely right, Crazycat.
If the base url doesn't match with bburl we can simply do a preventDefault() and push the call in a modal with warning message and further action buttons.
[Image: logo.svg.svg]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)