title | date | categories | |
---|---|---|---|
Douyin_downloadWachingVideo.Js |
2023-11-23 |
|
how to add bookmarklet in chrome
import { runScriptInCurrentTab } from "./helpers/utils.js"; export default { icon: "https://www.douyin.com/favicon.ico", name: { en: "Douyin – Download watching video", vi: "Douyin – Download watching video", }, description: { en: "Show all downloadable videos in current douyin webpage", en: "Show all downloadable videos in current douyin page", }, whiteList: ["https://www.douyin.com/*"], onClickExtension: async function() { const { downloadURL } = UsefulScriptGlobalPageContext.Utils; const src = await runScriptInCurrentTab(async() => { return await UsefulScriptGlobalPageContext.DOM.getWatchingVideoSrc(); }); if (!src) { alert("No video found."); return; } downloadURL(src, "douyin_video.mp4"); }, };