// ==UserScript==
// @name 从豆瓣电影直接跳转茶杯狐搜索资源
// @namespace https://cupfox.app/
// @version 0.0.6
// @author Cupfox
// @match *://movie.douban.com/subject/*
// @description 茶杯狐是一个影视资源聚合搜索引擎。安装脚本后豆瓣电影标题旁会显示茶杯狐的logo,点击就可以搜索影视资源了。
// @downloadURL https://update.greasyfork.icu/scripts/30020/%E4%BB%8E%E8%B1%86%E7%93%A3%E7%94%B5%E5%BD%B1%E7%9B%B4%E6%8E%A5%E8%B7%B3%E8%BD%AC%E8%8C%B6%E6%9D%AF%E7%8B%90%E6%90%9C%E7%B4%A2%E8%B5%84%E6%BA%90.user.js
// @updateURL https://update.greasyfork.icu/scripts/30020/%E4%BB%8E%E8%B1%86%E7%93%A3%E7%94%B5%E5%BD%B1%E7%9B%B4%E6%8E%A5%E8%B7%B3%E8%BD%AC%E8%8C%B6%E6%9D%AF%E7%8B%90%E6%90%9C%E7%B4%A2%E8%B5%84%E6%BA%90.meta.js
// ==/UserScript==
(function () {
var host = location.hostname;
if (host === 'movie.douban.com') {
const title = encodeURIComponent(document.querySelector('title').innerText.replace(/(^\s*)|(\s*$)/g, '').replace(' (豆瓣)', ''));
const subjectwrap = document.querySelector('h1');
const subject = document.querySelector('.year');
if (!subjectwrap || !subject) {
return;
}
const sectl = document.createElement('span');
subjectwrap.insertBefore(sectl, subject.nextSibling);
sectl.insertAdjacentHTML('beforebegin',
`
`
);
}
})();