Sleazy Fork is available in English.

Cam4 toggle fullscreen

Toggle your porno fullscreen with alt+enter.

Od 10.11.2018.. Pogledajte najnovija verzija.

  1. // ==UserScript==
  2. // @name Cam4 toggle fullscreen
  3. // @description Toggle your porno fullscreen with alt+enter.
  4. // @version 1
  5. // @include https://www.cam4.com/*
  6. // @match https://www.cam4.com/*
  7. // @grant none
  8. // @namespace Violentmonkey Scripts
  9. // ==/UserScript==
  10.  
  11. window.onload = initialize;
  12.  
  13. var _isFullScreen = false;
  14. var _htmlTag, _cam4HLSPlayer, _originalCam4HLSPlayerStyle = null;
  15.  
  16. function initialize() {
  17. try {
  18. _htmlTag = document.getElementsByTagName('html')[0];
  19. _cam4HLSPlayer = document.getElementById('Cam4HLSPlayer');
  20. _originalCam4HLSPlayerStyle = _cam4HLSPlayer.style;
  21. HLS.disconnect = null;
  22. document.addEventListener('keydown', catchKeyDown, false);
  23. } catch (exception) {
  24. console.warn('initialize.exception', exception);
  25. }
  26. }
  27.  
  28. function catchKeyDown(e) {
  29. if (e.keyCode == 13 && e.altKey) {
  30. toggleFullScreen();
  31. }
  32. }
  33.  
  34. function toggleFullScreen() {
  35. _isFullScreen = !_isFullScreen
  36. _htmlTag.style['overflow'] = _isFullScreen ? 'hidden' : 'auto';
  37. if (_isFullScreen) {
  38. _cam4HLSPlayer.style['position'] = 'fixed';
  39. _cam4HLSPlayer.style['top'] = 0;
  40. _cam4HLSPlayer.style['left'] = 0;
  41. _cam4HLSPlayer.style['height'] = '100vh';
  42. _cam4HLSPlayer.style['width'] = '100vw';
  43. _cam4HLSPlayer.style['z-index'] = 99999;
  44. } else {
  45. _cam4HLSPlayer.style = _originalCam4HLSPlayerStyle;
  46. }
  47. }