AcWing QuickAns

A simple script

  1. // ==UserScript==
  2. // @name AcWing QuickAns
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description A simple script
  6. // @author je5r1ta
  7. // @license MIT
  8. // @match https://www.acwing.com/activity/content/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=acwing.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. $(document).ready(function() {
  16. $(".center-block").show();
  17.  
  18. $(".punch-line").each(function() {
  19. // Get the URL of the problem from the href attribute of the first anchor tag within the div
  20. var problemURL = $(this).find("a:first").attr("href");
  21. // Create a new anchor tag with a button icon and the URL of the problem with a '?' appended to it
  22. var newButton = $("<a>").attr("href", problemURL + "?").attr("target", "_blank").addClass("btn btn-primary btn-xs").append($("<span>").addClass("glyphicon glyphicon-share-alt"));
  23. // Insert the new button after the first anchor tag within the div
  24. $(this).find("a:first").after(newButton);
  25. });
  26. });
  27.  
  28. let url = window.location.href;
  29. if (url.includes("?")) {
  30. location.href = $(".label-info").get(0).href;
  31. return;
  32. }
  33. })();

QingJ © 2025

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