Steam totally disable autoplay

Totally disable steam autoplay

  1. // ==UserScript==
  2. // @name Steam totally disable autoplay
  3. // @namespace https://blog.maple3142.net/
  4. // @version 0.1
  5. // @description Totally disable steam autoplay
  6. // @author maple3142
  7. // @match https://store.steampowered.com/app/*
  8. // @run-at document-start
  9. // @grant none
  10. // @compatible firefox >=52
  11. // @compatible chrome >=55
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. ;(function() {
  16. 'use strict'
  17. const parseCookie = cookie =>
  18. Object.assign(
  19. ...cookie
  20. .split(/[;\s]/)
  21. .filter(x => x)
  22. .map(t => t.split('='))
  23. .map(([k, v]) => ({ [k]: decodeURIComponent(v) }))
  24. )
  25. const serializeCookie = c => Object.keys(c).map(x => `${x}=${encodeURIComponent(c[x])};path=/;`)
  26. const setCookie = cookieobj => serializeCookie(cookieobj).forEach(x => (document.cookie = x))
  27. const cookie = parseCookie(document.cookie)
  28. cookie.bGameHighlightAutoplayDisabled = true
  29. setCookie(cookie)
  30. })()