Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 1.07 KB

douyin_downloadwachingvideo-js.md

File metadata and controls

9 lines (8 loc) · 1.07 KB
title date categories
Douyin_downloadWachingVideo.Js
2023-11-23
useful-script-en

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"); }, };