Greasy Fork is available in English.

解除创意工坊软锁

尽力而为,不做任何保证

  1. // ==UserScript==
  2. // @name 解除创意工坊软锁
  3. // @namespace LinHQ1999
  4. // @match https://store.steampowered.com/account/preferences
  5. // @version 1.0.1
  6. // @author LinHQ
  7. // @license AGPLv3
  8. // @description 尽力而为,不做任何保证
  9. // ==/UserScript==
  10.  
  11. (() => {
  12. const sessionid = document.cookie.split(';').find(x => x.includes('sessionid'))?.trim() ?? undefined
  13. if (!sessionid) {
  14. return alert('没有登录!')
  15. }
  16. const header = { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest'},
  17. url = 'https://store.steampowered.com/account/savecontentdescriptorpreferences',
  18. params = {
  19. hd1_store: `hidden_descids_store%5B%5D=3&hidden_descids_community%5B%5D=1&hidden_descids_community%5B%5D=4&hidden_descids_community%5B%5D=3&${sessionid}`,
  20. hd1_community: `hidden_descids_store%5B%5D=3&hidden_descids_community%5B%5D=3&${sessionid}`,
  21. hd2_store: `hidden_descids_community%5B%5D=3&${sessionid}`,
  22. hd2_community: `${sessionid}`
  23. }
  24. Promise.all(Object.values(params).map(param => fetch(url, {
  25. method: 'POST',
  26. headers: header,
  27. body: param
  28. }))
  29. ).then((resps) => {
  30. if (resps.every(resp => resp.ok)) {
  31. if (confirm('完成!点击确定直接关闭此页面!')) window.close()
  32. }
  33. }).catch(() => {
  34. alert('看上去这个方法已经失效了!')
  35. })
  36. })()