Git Product home page Git Product logo

Comments (3)

thompsonate avatar thompsonate commented on May 30, 2024

I wouldn't want to implement this with polling, especially since I'd have to deal with multiple browsers. Maybe the best solution would be a browser extension that sends an NSNotification, but that would take a lot of work to implement.

Probably the best solution for you, although not ideal, is to use a different browser for Netflix and set Shifty to disable for that browser. Also, customizable global keyboard shortcuts are coming in the next update, so that should make it easier to toggle manually.

from shifty.

choco avatar choco commented on May 30, 2024

I may give this a shot if you're interested, even though my Swift knowledge is basically nothing. My idea would be to add some logic in the updateCurrentApp method and:

Get the current app bundle id:

  1. If it matches a bundle id rules, disable Night Switch (basically the current logic)
  2. if it doesn't match any bundle id rule but it matches a browser rule:
    1. try and get current tab url and check for any rule matching that
    2. use accessibility api to setup notifications for listening on window title change
    3. when title changes, obtain the url again and check for rule again
    4. when focused app changes again, deactivate notifications

from shifty.

thompsonate avatar thompsonate commented on May 30, 2024

If we can get notifications on window title change, then this is exactly what we'd want to do. Feel free to give it a shot!

from shifty.

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.