Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Is This Possible?

I'm trying to block/disable some JS code (e.g., adsense) in the android webview and ios UIwebview of my forum. Currently the only solution is to hide the JS code on mobile version using the pockets plugin.

What I'm trying to do is have the JS code only show when the mobile browser used. I don't want the JS code to show in the app versions.

Does this involve using user agents?

Another option if possible, is to use a subdomain, m.domain.com that uses the same database as the main site but uses it's own Vanilla dashboard.
So the main forum folder and mobile forum folder in the html folder. This will most likely not work.

Thanks

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You can disable the loading of files by adding some code to the specific plugins you do not want to load on mobile. Or you can do it via the theme hooks of your mobile theme.

    example of checking to see if it is a mobile device, if it is then the file will not get loaded:

    public function Base_Render_Before($Sender) {
    if(IsMobile()){
     return;
    }
    else
    {
    $Sender->AddJsFile('path to js file');
      }
    }
    
Sign In or Register to comment.