巴哈姆特之收藏前確認

為了我每次都手殘點到收藏的朋友而做,可以防止誤觸收藏按鈕。

目前為 2021-08-23 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 巴哈姆特之收藏前確認
  3. // @description 為了我每次都手殘點到收藏的朋友而做,可以防止誤觸收藏按鈕。
  4. // @namespace nathan60107
  5. // @version 1.6
  6. // @author nathan60107(貝果)
  7. // @homepage https://home.gamer.com.tw/homeindex.php?owner=nathan60107
  8. // @include https://forum.gamer.com.tw/C*
  9. // @include https://home.gamer.com.tw/bahawall.php?*
  10. // @include *.gamer.com.tw/singleACMsg.php*
  11. // @include https://guild.gamer.com.tw/guild.php*
  12. // @noframes
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. if(location.href.match("https://forum.gamer.com.tw/C")!=null){
  17. let newFunc = FORUM_homeBookmark.toString();
  18. newFunc = newFunc.replace(`function FORUM_homeBookmark(area,bsn,sn,atitle,dc1,dc2,dtype,dmachine,dname){`, `function FORUM_homeBookmark(area,bsn,sn,atitle,dc1,dc2,dtype,dmachine,dname){Dialogify.confirm('確定要收藏?',{ok: function(){`);
  19. newFunc = newFunc.replace(`;return false}`, `;return false}})}`);
  20. FORUM_homeBookmark = new Function("return "+newFunc)();
  21. }else if(location.href.match("https://home.gamer.com.tw/bahawall.php")!=null || location.href.match(".gamer.com.tw/singleACMsg.php")!=null || location.href.match("https://guild.gamer.com.tw/guild.php")!=null){
  22. var newFunc = giveGPBP.toString();
  23. newFunc = newFunc.replace(`function giveGPBP(e,t){$`, `function giveGPBP(e,t){function postGBP(){$`);
  24. newFunc = newFunc.replace(`})}`, `})}
  25. if (e == "GP") postGBP();
  26. else if (e == "BP") Dialogify.confirm('確定要噓?', {
  27. ok: function(){postGBP();}
  28. })}`);
  29. giveGPBP = new Function("return "+newFunc)();
  30. }
  31. })();
  32.