虚假品牌内容检测(页面边缘提示框 + 弹窗)

检测网页中的虚假品牌内容,在页面边缘显示提示框,并弹窗一次性显示所有虚假品牌

  1. // ==UserScript==
  2. // @name 虚假品牌内容检测(页面边缘提示框 + 弹窗)
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 检测网页中的虚假品牌内容,在页面边缘显示提示框,并弹窗一次性显示所有虚假品牌
  6. // @author JJYY
  7. // @license https://gf.qytechs.cn/
  8. // @match *://*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 定义虚假品牌关键词列表
  16. const fakeBrands = [
  17. 'GRISSO','格瑞索','New Health','新海思','Kicooted','凯康特','FLALIU','DDZ水蛭素','Qlane成长赖氨酸',
  18. ];
  19.  
  20. // 用于存储检测到的虚假品牌
  21. const detectedBrands = new Set();
  22.  
  23. // 遍历页面中的所有文本节点
  24. const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
  25. let node;
  26. while (node = walker.nextNode()) {
  27. const text = node.nodeValue;
  28.  
  29. // 检查文本中是否包含虚假品牌关键词
  30. fakeBrands.forEach(brand => {
  31. if (text.includes(brand)) {
  32. detectedBrands.add(brand); // 将检测到的品牌添加到集合中
  33. }
  34. });
  35. }
  36.  
  37. // 如果有检测到虚假品牌
  38. if (detectedBrands.size > 0) {
  39. // 创建页面边缘提示框
  40. const warningBox = document.createElement('div');
  41. warningBox.style.position = 'fixed';
  42. warningBox.style.top = '20px';
  43. warningBox.style.right = '20px';
  44. warningBox.style.backgroundColor = '#ffebee';
  45. warningBox.style.border = '2px solid #ff1744';
  46. warningBox.style.borderRadius = '8px';
  47. warningBox.style.padding = '10px';
  48. warningBox.style.zIndex = '10000';
  49. warningBox.style.fontFamily = 'Arial, sans-serif';
  50. warningBox.style.boxShadow = '0 2px 10px rgba(0, 0, 0, 0.2)';
  51.  
  52. // 创建提示框标题
  53. const title = document.createElement('h3');
  54. title.textContent = '⚠️ 检测到虚假品牌';
  55. title.style.color = '#d32f2f';
  56. title.style.margin = '0 0 10px 0';
  57. warningBox.appendChild(title);
  58.  
  59. // 创建品牌列表
  60. const list = document.createElement('ul');
  61. list.style.margin = '0';
  62. list.style.paddingLeft = '20px';
  63. detectedBrands.forEach(brand => {
  64. const item = document.createElement('li');
  65. item.textContent = brand;
  66. item.style.color = '#d32f2f';
  67. list.appendChild(item);
  68. });
  69. warningBox.appendChild(list);
  70.  
  71. // 将提示框添加到页面中
  72. document.body.appendChild(warningBox);
  73.  
  74. // 创建弹窗提示
  75. const alertMessage = `检测到以下虚假品牌:\n${Array.from(detectedBrands).join('\n')}`;
  76. alert(alertMessage); // 弹窗显示所有虚假品牌
  77. }
  78. })();

QingJ © 2025

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