Add Game Title in PS Store

As title for the new PS Store

  1. // ==UserScript==
  2. // @name Add Game Title in PS Store
  3. // @version 0.1
  4. // @namespace https://greasyfork.org/users/179168
  5. // @description As title for the new PS Store
  6. // @match https://store.playstation.com/*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  8. // @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
  9. // @grant GM_addStyle
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. waitForKeyElements('div.ems-sdk-product-tile-image__container span img', addGameTitle);
  15.  
  16. function addGameTitle (jNode) {
  17. var alt = $(jNode).attr('alt');
  18. var grandpa = $(jNode).parent().parent().parent().parent();
  19. if ($(grandpa).find('section div.game-title').length == 0) {
  20. $(grandpa).find('section div.price__container').before('<div class="game-title">' + alt + '</div>');
  21. }
  22. }
  23. })();
  24.  
  25. GM_addStyle( `
  26. .game-title {
  27. font-size: 14px;
  28. margin-top: .25rem;
  29. overflow: hidden;
  30. display: block;
  31. display: -webkit-box;
  32. -webkit-line-clamp: 2;
  33. -webkit-box-orient: vertical;
  34. }
  35. `);