Giter Club home page Giter Club logo

Comments (4)

ain avatar ain commented on June 10, 2024

It's not clear what's the exact platform you're targeting and what's the User-Agent, but your ^.Win$ regex would not work for the following Windows Mobile:

Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; ...) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/..

For the above, the effective regular expression would be .*Windows Phone.*.

from smartbanner.js.

ahmedshalaby2018 avatar ahmedshalaby2018 commented on June 10, 2024

thanks it's works fine with .Windows NT.
but Can I exclude all website frame work mac windows etc .... ?

from smartbanner.js.

ain avatar ain commented on June 10, 2024

@ahmedshalaby2018 smartbanner.js is meant to be used on mobile. Promoting the app on desktop is usually not desired, it should not appear on desktop.

Nevertheless, you can indeed extend the exclusion regex by piping the platforms, e.g. .*(Windows NT|Intel Mac OS X).* etc.

from smartbanner.js.

citrusella avatar citrusella commented on June 10, 2024

This might not be related to why the original creator of this issue was asking this, but for what it's worth, a website I use that I'm pretty sure is using this to promote their app on mobile recently updated from 1.17 to 1.19 (with no other changes I can find to the banner code or anything) and I pretty much immediately started seeing iOS app promotion on my Windows 10 laptop computer. All I can ascertain is that this is because between those two versions, catching iPad 13+ appears to have been added by checking if the browser has more than 0 maxTouchPoints (and because my computer is a touch screen, my browser tells it that it does in fact have more than 0 touch points and so I see the banner). I may be sniffing up the wrong tree but I saw this issue and felt like it was worth mentioning.

(And as a note, I've reported this to the website itself so they know about it; despite my report there being recent enough that I haven't heard back (and normally I would be very patient and wait), I'm mentioning it here too because I found this while trying to investigate the cause myself and didn't want to forget I found it.)

TL;DR: I think in trying to cover iOS devices with user agents that aren't clearly mobile user agents, it also resulted in unintended overlap with desktop/laptop devices that definitely aren't mobile but which happen to have touch points, so some desktop users (namely, ones with touchscreens) are seeing iOS banners.

from smartbanner.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.