Comments (8)
Hey,
You can hide the banner only on iOS Safari using the following exclusion:
<meta name="smartbanner:exclude-user-agent-regex" content="^.*iPhone(?!.*CriOS).*Safari">
from smartbanner.js.
Component comes without API and has only meta
tag support currently.
You can use:
enabled-platforms
withandroid
and withoutios
include-user-agent-regex
with.*Android.*
, see documentation
from smartbanner.js.
Never mind, I used something like this:
var md = new MobileDetect(window.navigator.userAgent);
if (md.userAgent() == 'Safari') {
$('body').addClass('hide-smartapp-banner');
}
And the css is
.hide-smartapp-banner .smartbanner {
display: none !important;
}
Thanks a lot for this awesome plugin.
from smartbanner.js.
You can use this exclusion
name="smartbanner:exclude-user-agent-regex" content="^((?!Chrome|Android|FxiOS|CriOS).)*Safari"
from smartbanner.js.
Yes, it is. Please refer to Hide the smartbanner for certain User Agents.
In your case the following should do:
<meta name="smartbanner:exclude-user-agent-regex" content=".*Safari.*">
from smartbanner.js.
but this hides the bar for chrome on iPhone as well. Is there any way to programmatically set the banner as I want to?
from smartbanner.js.
iPhone also runs Safari. In that case you need to work out a regular expression that targets desktop exclusively.
from smartbanner.js.
the thing is - I need to show this on:
chrome - andoird and iphone
safari - not at all.
there is a legacy code in the project that can detect it but I need that the bar will be disabled by default and I could do something like:
smartbanner = new SmartBanner();
if (foo) {
smartbanner.publish();
}
Is that possible?
from smartbanner.js.
Related Issues (20)
- Hide smart app banner in web app HOT 4
- Smartbanner for Huawei without Play Store HOT 1
- Smart Banner ios version displayed for touch screen enabled desktops HOT 1
- Angular 2+ compatibility HOT 1
- How to hide smartapp banner in webview apps HOT 1
- Why app banner is displaying in laptop screens, 1440 X 734 / 1366 X 768? HOT 8
- Is there a way to add two smart banners? HOT 1
- support for another language in content ? HOT 3
- min file no correctly exported? HOT 2
- Does it work in Angular? For me it is not showing HOT 1
- Unexpected token ')' when close banner HOT 1
- Invisible App Icon HOT 3
- Will view button be changed to open button if app is already installed in mobile(android or iOS ? HOT 1
- Windows Convertibles are recognized as iOS devices HOT 5
- Accessibility concern with tabbing to banner HOT 5
- smartbanner is visible on windows tab when enabled-platforms is set to android,ios HOT 3
- Error library when I use install with npm HOT 14
- Required content HOT 6
- Js and CSS files are throwing error HOT 5
- Value for enabled-platforms HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartbanner.js.