richtr / NoSleep.js

Prevent display sleep and enable wake lock in any Android or iOS web browser.
MIT License
2.19k stars 379 forks source link

Fix #134 #135 #136 #138

Open alebianco-doxee opened 2 years ago

alebianco-doxee commented 2 years ago

This PR contains a:

Motivation / Use-Case

Fixes NoSleep not working in recent iOS versions with the solution found by @z-x https://github.com/richtr/NoSleep.js/issues/135 https://github.com/richtr/NoSleep.js/issues/136

Also fixes NoSleep not working on Samsung Browser due to permission denied error https://github.com/richtr/NoSleep.js/issues/134

z-x commented 2 years ago

Thanks!

Moongazer commented 2 years ago

It would be amazing if this fix is merged soon into a 0.12.1 patch version or so. We've also quite a lot of iOS users recently complaining that the screen goes black while using our App. Thanks for your work guys!

CodeCommander commented 2 years ago

I can confirm this fixed NoSleep.js on iOS 15.1 in my app.

zamarawka commented 2 years ago

@richtr Any way to merge it?

Romander commented 2 years ago

Hey guys, it will be perfect if it will be merged 🙌

dcbarans commented 2 years ago

@zamarawka it looks like @richtr has made zero contributions this year.. I wonder if this is a dead repo :(

Uriopass commented 2 years ago

Since the owner seems dead, I republished it as another package under @uriopass/nosleep.js with version 0.12.1

timtribers commented 2 years ago

@Uriopass @alebianco-doxee @z-x @Moongazer @huppfi @CodeCommander @zamarawka @Romander @dcbarans - please, please, please will one of you kind people consider taking this on and creating an "official" fork which we can all come together around? The functionality of nosleep is simply too important not to have a maintained solution (and @richtr definitely seems to have disappeared :( ) - otherwise we are going to end up with a 1000 forks!

If it helps, I am sure some sponsor/patreon/etc. income could be generated for an active repo.

kylemacfarlane commented 2 years ago

The fix from #135 breaks Firefox if the script is loaded before the body tag. Appending to body needs to be delayed with something like:

document.addEventListener("DOMContentLoaded", function() { 
  document.querySelector("body").append(this.noSleepVideo);
});
ezekiel747 commented 1 year ago

Since the owner seems dead, I republished it as another package under @uriopass/nosleep.js with version 0.12.1

Awesome, thank you! Could you please change the installation instructions in the readme to include the updated package name?

Uriopass commented 1 year ago

Since the owner seems dead, I republished it as another package under @uriopass/nosleep.js with version 0.12.1

Awesome, thank you! Could you please change the installation instructions in the readme to include the updated package name?

Done :)

ezekiel747 commented 1 year ago

I've checked and the Readme file still contains: This package is published to npm as nosleep.js and can be installed with: npm install nosleep.js

Uriopass commented 1 year ago

Ah sorry you're talking about the npm page! I'll fix this

EDIT: Done

SUCHiDEV commented 1 year ago

@Uriopass will you update your version?

Uriopass commented 1 year ago

I don't see what's there to update