您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds functionality for copying quizlet lists to the clipboard
当前为
- // ==UserScript==
- // @name Quizlet.com Export
- // @version 1.0.0
- // @author petracoding
- // @namespace petracoding
- // @grant none
- // @license MIT
- // @include https://quizlet.com/*
- // @include http://quizlet.com/*
- // @include https://www.quizlet.com/*
- // @include http://www.quizlet.com/*
- // @description Adds functionality for copying quizlet lists to the clipboard
- // ==/UserScript==
- // SETTINGS:
- const delimiter = "\n"; // Use "\n" for a new line. Default: "\n"
- const delimiterBetweenWords = "\n\n"; // Use "\n" for a new line. Default: "\n\n"
- // DO NOT CHANGE ANYTHING BELOW HERE.
- start();
- function start() {
- const wrapper = document.querySelector(".SetPageHeader");
- if (!wrapper) return;
- wrapper.innerHTML = wrapper.innerHTML + `
- <br/><div class="primary"><a class="action-1 button quizlet-export">Copy to clipboard</a></div>
- `;
- const btn = document.querySelector(".quizlet-export");
- btn.addEventListener("click", () => {
- copy();
- });
- }
- function copy() {
- const list = document.querySelectorAll(".SetPage-content .SetPageTerms-term");
- let output = "";
- [...list].forEach((li) => {
- if (li.querySelector(".count")) {
- li.querySelector(".count").remove();
- }
- output += li.querySelector(".SetPageTerm-wordText .TermText").innerHTML.trim() + delimiter + li.querySelector(".SetPageTerm-definitionText .TermText").innerHTML + delimiterBetweenWords;
- });
- navigator.clipboard.writeText(output);
- alert("Done! All visible terms have been copied to the clipboard, you can now paste them anywhere.\n\nIf you are missing terms make sure to scroll down on your Quizlet list and load all terms before pressing the copy button.");
- }