Comments (6)
Alpha build available through:
https://github.com/greasemonkey/greasemonkey/releases
from maia-yt.
Interesting. I will need to do a few changes for how I handle saving and loading settings.
The main part that I need to revisit for this to work correctly is to probably make the synchronous parts of the modules accept asynchronous responses. This needs to be handled in the core code where I intercept the yt.player.Application.create
method. Moreover that method is a synchronous method and things might break if the player is not created immediately after the method is called.
It might be possible to not use asynchronous code in the modules and instead cache the settings. I will need to experiment with this before I can decide on which way to go.
from maia-yt.
@YePpHa So far the only one that needs to be asynchronous (or at least behaves as such) is the *.getValue method and the timing is not noticeable while trying to do the first interceptions. I've made a GM 3.* / 4 make-shift poly-fill here if it helps:
and the new use for *.getValue
Decided not to make use of await
since it required making the entire script async
from what I gathered.
from maia-yt.
@Yonezpt I've decided to try out making Maia asynchronous as it would be the most ideal thing. I might also just scrap making it asynchronous and preload all settings and let the handlePlayerCreate
method wait for it to preload before starting. It really depends on if I experience some show stopper due to async interacting with a sync environment.
I've been experimenting with making Maia asynchronous and it works for the most part. I haven't been able to change everything as the API calls to the YouTube player are all synchronous. If I want to intercept them I can't do that asynchronous except if I don't need to return a value. That means some of the API calls I can intercept asynchronous and some I can't. The good news is that the current API calls I intercept can be asynchronous.
The preventing of player events are not working in the async environment due to the current event system in Maia being synchronous as it's based on the DOM events.
Branch: https://github.com/YePpHa/maia-yt/tree/async
Test build with support for GreaseMonkey v4:
maia.user.js.zip
from maia-yt.
Okay, I've done some more tests. I've decided to not make Maia asynchronous as it introduces unneeded complexity in translating between synchronous and asynchronous environments.
What I will do instead is to preload the storage for each module and prevent yt.player.Application.create
from starting before it has completed the preload.
from maia-yt.
I've implemented GM4 in v0.1.9.
from maia-yt.
Related Issues (20)
- An in-range update of webpack is breaking the build 🚨 HOT 15
- An in-range update of @types/jasmine is breaking the build 🚨 HOT 2
- An in-range update of preact is breaking the build 🚨 HOT 3
- It seems like disabling the loading of the next video is not working anymore HOT 1
- Replace Inversify with my own DI: ts-di-transformer
- Playback broken with youtube as of today HOT 3
- It looks like Maia breaks loading of stream and crashes the Waterfox content process. HOT 11
- Not highest quality video is played HOT 4
- Sorry for this spam... what is this script/extension?
- Player size
- Option to prefer multi-channel, and higher quality audio
- An in-range update of webpack is breaking the build 🚨 HOT 20
- An in-range update of @types/jasmine is breaking the build 🚨 HOT 17
- How do I use the webextension version? HOT 5
- Youtube center dont show Rating Bar any more HOT 1
- An in-range update of @types/uuid is breaking the build 🚨 HOT 1
- Any good alternatives to Maia and Youtube Center? HOT 14
- Greenkeeper has been sold and canned. HOT 3
- yarn build error HOT 1
- How do I get latest version, does it function? Are any features still working
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 maia-yt.