tastedive yohoho injector

inject yohoho iframe by youtube iframe in tastedive site

目前為 2023-01-15 提交的版本,檢視 最新版本

// ==UserScript==
// @name         tastedive yohoho injector
// @description  inject yohoho iframe by youtube iframe in tastedive site
// @match        https://tastedive.com/*
// @grant        GM_getResourceText
// @license MIT
// @version 0.0.1.20230115145957
// @namespace https://gf.qytechs.cn/users/739921
// ==/UserScript==

let iframe;
let search=true;
let observer = new MutationObserver(mutationRecords => {
    if(search){
  const ifr = document.querySelector(".tk-Tear-video")
  if(ifr){
      search=false
      const script = document.createElement('script')
      script.src = "https://yohoho.cc/yo.js"
      document.body.appendChild(script)
      const preview = document.querySelector(`div[class='video-preview']`)
      const title = document.querySelector(`div[class="primary-entity js-entity"]`).getAttribute("data-resource-name")
      const year = document.querySelector(`div[class="primary-entity js-entity"]`).getAttribute("data-disambiguation")
      preview.innerHTML = `<div id="yohoho" data-title="${title} (${year})"></div>`
      search=true
}
    }

});

observer.observe(document, {
  childList: true,
  subtree: true,
  characterDataOldValue: true
});

QingJ © 2025

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