Board logo

標題: [操作疑難] tampermonkey 可唔可以改變裝站上粒 button? [打印本頁]

作者: 199hehehaha    時間: 2023-6-11 22:26     標題: tampermonkey 可唔可以改變裝站上粒 button?

即係好似呢張圖咁, 原本係需要拉過去, 可唔可直接改做click button?


作者: alan11abc    時間: 2023-6-12 03:54

太耐沒上其他網,乜有呢種蠢設計……
直接改CSS, 之類?套返clicked values 。。

9u, ,沒做過 。但應該得

via HKEPC IR 5.1.14 - Android(5.1.1F)
作者: 199hehehaha    時間: 2023-6-12 21:59

請教應該可以點樣改?

<button type="submit" class="">Slide<span class="arrow-right"> →</span></button>
作者: justiceice    時間: 2023-6-13 08:59

請教應該可以點樣改?

Slide →
199hehehaha 發表於 2023-6-12 21:59



    document.querySelector('button[type="submit"] .arrow-right').parentNode.click();

會唔會得?
作者: 199hehehaha    時間: 2023-6-14 16:51

document.querySelector('button[type="submit"] .arrow-right').parentNode.click();

會唔會得? ...
justiceice 發表於 2023-6-13 08:59



    THX, 不過唔得
作者: louislam    時間: 2023-6-15 11:45

我估佢用js trigger event, 可以試下用F12 裡面有個 Event Listener Breakpoints, 剔晒佢

之後submit, 睇下會唔會喺邊句CODE停底


[attach]2377395[/attach]
作者: javacomhk    時間: 2023-6-17 21:45

  1. // ==UserScript==
  2. // @name         Change Button Code
  3. // @version      0.1
  4. // @description  This script will change the code of a button and add a click action.
  5. // @author       Bard
  6. // @match        https://www.example.com/*
  7. // @grant        none
  8. // ==/UserScript==

  9. (function() {
  10.   // Find the button element
  11.   var button = document.querySelector("button[type='submit']")

  12.   // Change the code of the button
  13.   button.innerHTML = "Click"

  14.   // Add a click action to the button
  15.   button.addEventListener("click", function() {
  16.     alert("You clicked the button!");
  17.   })
  18. })()
複製代碼





歡迎光臨 電腦領域 HKEPC Hardware (https://www.hkepc.com/forum/) Powered by Discuz! 7.2