Greasy Fork is available in English.

Pocket Comics AP Features

Adds search on AP and grabbing vertical cover for Pocket Comics series (via Search). Based on Quin15 scripts.

  1. // ==UserScript==
  2. // @name Pocket Comics AP Features
  3. // @namespace https://greasyfork.org/en/users/787696-kpossibles
  4. // @version 1.0.3
  5. // @description Adds search on AP and grabbing vertical cover for Pocket Comics series (via Search). Based on Quin15 scripts.
  6. // @author kpossibles
  7. // @match https://www.pocketcomics.com/comic/*
  8. // @match https://www.pocketcomics.com/search/*
  9. // @icon https://www.google.com/s2/favicons?domain=pocketcomics.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var appendButtons = function() {
  14. var btnCont = document.createElement('div');
  15. // use button container class from website
  16. btnCont.className = "add_product";
  17. btnCont.style = "margin-top:10px";
  18. // where you want the buttons to appear
  19. if (location.href.match(/search/)) {
  20. document.querySelector('.list_comic').appendChild(btnCont);
  21. } else {
  22. document.querySelector('.info_product').appendChild(btnCont);
  23. }
  24. var searchAP = document.createElement('a')
  25. // use button class style from website
  26. searchAP.className = "btn_info";
  27. searchAP.style = "height: 50px;overflow-wrap: normal;overflow: auto;white-space: pre-wrap;cursor: pointer;background-color:#FC5342;";
  28. searchAP.innerHTML = `<img src="https://www.anime-planet.com/favicon.ico" style="float:left;height:30px;margin:10px 10px 0px 0px;"><p style="font-size: 14px;white-space: break-spaces;vertical-align: middle;display: inline-block;">Search On AP</p>`;
  29. btnCont.appendChild(searchAP);
  30. var ENtitle = "";
  31. if (location.href.match(/search/)) {
  32. ENtitle = document.querySelector('strong.tit_comic').innerText;
  33. } else {
  34. ENtitle = document.querySelector('strong.tit_product').innerText;
  35. }
  36. searchAP.addEventListener("click", function() {open(encodeURI("https://www.anime-planet.com/manga/all?name=" + ENtitle), "")});
  37.  
  38. var coverImg = document.createElement('a')
  39. // use button class style from website
  40. coverImg.className = "btn_info";
  41. var imgSrc = "";
  42. if (location.href.match(/search/)) {
  43. imgSrc = document.querySelectorAll(".img_thumb")[0].src;
  44. } else {
  45. imgSrc = document.querySelector('div.thumb_comic.thumb_keyvisual img').src;
  46. }
  47. coverImg.style = "height: 50px;overflow-wrap: normal;overflow: auto;white-space: pre-wrap;cursor: pointer;background-color:#193767;'";
  48. coverImg.innerHTML = `<img src="` + imgSrc + `" style="float:left;height:30px;margin:10px 10px 0px 0px;"><p style="font-size: 14px;white-space: break-spaces;line-height: 15px;vertical-align: middle;display: inline-block;">Open Cover Image</p>`;
  49. btnCont.appendChild(coverImg);
  50. coverImg.addEventListener("click", function() {open(imgSrc, "")});
  51.  
  52. var searchMU = document.createElement('a')
  53. searchMU.className = "link_first";
  54. searchMU.style = "height: 50px;overflow-wrap: normal;overflow: auto;white-space: pre-wrap;cursor: pointer; border:1px solid gray;";
  55. searchMU.innerHTML = `<img src="https://www.mangaupdates.com/images/manga-updates.svg" style="float:left;height:30px;margin:10px 10px 0px 0px;"><p style="font-size: 14px;white-space: break-spaces;vertical-align: middle;display: inline-block;">Search On MU</p>`;
  56. btnCont.appendChild(searchMU);
  57. searchMU.addEventListener("click", function() {
  58. open(encodeURI("https://www.mangaupdates.com/site/search/result?search=" + ENtitle), "")
  59. });
  60. }
  61.  
  62. var checkElems = function() {
  63. if (document.querySelector('.txt_info')) {
  64. setTimeout(appendButtons, 1000);
  65. } else if (document.querySelector('div.thumb_comic.thumb_keyvisual')) {
  66. setTimeout(appendButtons, 1000);
  67. } else {
  68. setTimeout(checkElems, 100);
  69. };
  70. };
  71.  
  72. checkElems();