OOCSI Message Handler

Handle OOCSI messages and redirect to Amazon for purchasing

  1. /* global OOCSI */
  2. // ==UserScript==
  3. // @name OOCSI Message Handler
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.1
  6. // @description Handle OOCSI messages and redirect to Amazon for purchasing
  7. // @match https://*.aooo.nl/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Include the OOCSI library
  16. const script = document.createElement('script');
  17. script.src = "https://oocsi.aooo.nl/assets/js/oocsi-web.min.js";
  18. script.onload = function() {
  19. // Connect to the OOCSI server
  20. OOCSI.connect('wss://oocsi.aooo.nl/ws');
  21.  
  22. // Subscribe to the channel and handle messages
  23. OOCSI.subscribe("amazonBuyChannel", function(msg) {
  24. var url = msg.data.url; // Assuming the URL is passed here
  25. var type = msg.data.type; // 'new' or 'used'
  26. // Append the type as a query parameter to handle on the Amazon page
  27. if (url && type) {
  28. window.open(url + '?purchaseType=' + type, '_blank').focus();
  29. }
  30. });
  31. };
  32. document.head.appendChild(script);
  33. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址