Whatsapp Web Break photo single view

See single view photo on whatsapp web without limitations

  1. // ==UserScript==
  2. // @name Whatsapp Web Break photo single view
  3. // @namespace Buzatto
  4. // @version 0.1
  5. // @description See single view photo on whatsapp web without limitations
  6. // @author buzatto
  7. // @match https://web.whatsapp.com/
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11.  
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const loadModule = (name, id) => {
  17. window.ErrorGuard?.skipGuardGlobal(true);
  18. return new Promise(r => {
  19. try {
  20. window.webpackChunkwhatsapp_web_client?.push([
  21. [Math.random()], {},
  22. e => {
  23. const module = e(id);
  24. r(module.default ? module.default : module);
  25. }
  26. ]);
  27. r(window.require?.(name));
  28. } catch (e) {
  29. r(null);
  30. }
  31. });
  32. };
  33.  
  34. const getIndexedDB = (database, table, key) => {
  35. // ... (resto da função getIndexedDB como no código original)
  36. };
  37.  
  38. const setIndexedDB = (database, table, object) => {
  39. // ... (resto da função setIndexedDB como no código original)
  40. };
  41.  
  42. const initScript = async () => {
  43. if (!document.querySelector("#side")) {
  44. setTimeout(initScript, 1000);
  45. return;
  46. }
  47.  
  48. (await loadModule("WAWebCollections", 729804))
  49. .Msg.on("add", async msg => {
  50. msg.__x_isViewOnce = false;
  51.  
  52. const IDBmessage = await getIndexedDB("model-storage", "message", msg.id._serialized);
  53. if (!IDBmessage) return;
  54. IDBmessage.isViewOnce = false;
  55. setIndexedDB("model-storage", "message", IDBmessage);
  56. });
  57.  
  58. (await loadModule("WAWebChatCollection", 351053))
  59. .ChatCollection.getModelsArray()
  60. .forEach(async e => {
  61. const lastMessage = e.msgs._models[e.msgs._models.length - 1];
  62. if (!lastMessage) return;
  63.  
  64. lastMessage.isViewOnce = false;
  65.  
  66. const IDBmessage = await getIndexedDB("model-storage", "message", lastMessage.id._serialized);
  67. if (!IDBmessage) return;
  68. IDBmessage.isViewOnce = false;
  69. setIndexedDB("model-storage", "message", IDBmessage);
  70. });
  71. };
  72.  
  73. // Inicia o script quando a página estiver carregada
  74. if (document.readyState === "complete" || document.readyState === "interactive") {
  75. initScript();
  76. } else {
  77. document.addEventListener("DOMContentLoaded", initScript);
  78. }
  79. })();