Coder Social home page Coder Social logo

Comments (4)

reillyeon avatar reillyeon commented on August 15, 2024

The intent of this text is to attach these steps to the "loss of visibility" or "loss of full activity" event on any document. It feels like it should be something like,

When the user agent determines that a document is no longer fully active, it must run these steps:

  1. Let document be that document.
  2. ...

The abort all active watchAdvertisements algorithm should really be taking the document (or the document's navigator.bluetooth instance) as a parameter.

Does that make sense? Can you suggest the proper way to create such an event listener?

from web-bluetooth.

Ms2ger avatar Ms2ger commented on August 15, 2024

Thanks! The <object> spec does something similar:

Whenever one of the following conditions occur:
...

...
(do some stuff)

so I'm guessing something like what you quoted would be fine.

CC @annevk

from web-bluetooth.

annevk avatar annevk commented on August 15, 2024

Yeah, probably. Getting some of this formalized better is a long-standing issue of the HTML standard.

from web-bluetooth.

reillyeon avatar reillyeon commented on August 15, 2024

What do you think of this?

When a document's visibility state changes,

  1. Let document be the document.
  2. Let global be document's relevant global object.
  3. Queue a task on the Bluetooth event source with global and the following steps,
    1. If document’s visibility state is not "visible", then abort all active watchAdvertisements operations on global.

I'm unsure when I want to use the "document" concept vs. the "Document" interface.

To get the Bluetooth instance from a document it seems like I should go through the associated Navigator (given global) and define a similar "associated Bluetooth" concept which is used in the getter steps for the "bluetooth" attribute in the Navigator partial interface.

from web-bluetooth.

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.