Comments (4)
I think it might be more productive to think of this as document-level vs scope-level, which has tab vs app badging as a consequence.
The section in the explainer which outlines examples for document-level badging does a good job of motivating document-level badging in general; once you accept that, you are then in a position where having both document-level and scope-level badging available on the same document with the same UI surface is going to cause conflicts, and document-level badging makes more sense for things which are acting as documents.
Then it's straightforward to argue that you can get scope-like behaviour from document-level badging, since if you have a document open in a desktop browser context it is likely to be updating the actual document, even if you have multiple views on the same server state (e.g. two tabs open to the same Gmail inbox or Slack team).
Conversely, for an installed app or bookmark, there won't necessarily be a document open to badge, or there may be more than one document open but only one UI surface to show a badge on (the dock or homescreen icon), so a scope-level API makes more sense there.
from badging.
@marcoscaceres (from #48)
No strong opinions about separation. I still personally have reservations regarding scope, but will discuss internally. I'm also a bit on the fence about the default scope being the origin. I'd feel more comfortable if scope was just the current document, and then scope could be expanded via options.
If we separated, then scope would only apply to the app (or "handle") badging cases, not individual pages. So it wouldn't make sense for it to apply to the current document, since you would almost never want to badge just one document, but an entire app (which is almost always an entire origin).
I'm very against the default scope being the current document, because then it's easy to accidentally get it wrong: you test the badge API on your main page and it works. But then you have a bug that when you call Badge.set()
from any other page in the site, it does nothing.
I'm not entirely sold on
.canBadgeDocument()
. I think if the Badge API is there,canBadgeDocument
is implied... otherwise, the UA shouldn't include the API.
That's true if we separate the APIs out: then the presence of the badge-this-document API implies that the document will be badged. If we keep a single API as currently described in the explainer, then we need a feature detector for the specific case of "will use of the Badge API cause the badge to show up on my document's tab, on or near the favicon" (so that I know whether to fall back to injecting the badge into the favicon image itself).
from badging.
I think we're fairly settled on this approach. Once the changes proposed in #55 land we should be able to close this.
from badging.
Changes landed. The explainer now presents two separate APIs.
from badging.
Related Issues (20)
- What's the status with Badge API for iOS? HOT 6
- App badging supposed to work while PWA is not open? HOT 2
- [Browsers Extensions]: Silent Badge updates should be supported in browser extensions
- badging without installing pwa HOT 2
- Android support, at least HOT 4
- TPAC 2022 status report
- Broken references in Badging API
- Deal with non-fully active documents HOT 2
- Should third-parties be allowed to use the API? HOT 2
- Disassociate badging from manifest
- Selectively exposing the API could be a fingerprinting vector HOT 3
- A means to associate a badge with an installed application HOT 1
- CFC to publish as First Public Working Draft HOT 3
- Test API in workers HOT 1
- Clarify what to do when some badging mode is not supported HOT 3
- Set up auto publish HOT 1
- PWA HOT 4
- Checking against top-level origin should use same origin-domain
- Question regarding Android mobile support HOT 3
- Notification permission requirement HOT 5
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 badging.