Quizlet embed redirector

Quizlet redirect to embed

目前为 2024-02-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Quizlet embed redirector
  3. // @namespace https://quizlet.com
  4. // @version 1.0
  5. // @description Quizlet redirect to embed
  6. // @match https://quizlet.com/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12. var currentURL = window.location.href;
  13. var match = currentURL.match(/quizlet\.com\/(\d+)/i);
  14.  
  15. if (match && currentURL.indexOf('/embed') === -1) {
  16. var number = match[1];
  17. var newURL = 'https://quizlet.com/' + number + '/learn/embed';
  18.  
  19. document.location.href = newURL;
  20. }
  21. })();