本帖最后由 dada02 于 2025-11-14 11:52 编辑
谷歌浏览器多插件平台
【根据网友建议,需要增加音视频链接、网页链接关键词搜索和导出EXCEL、密码管理自动登录等相关功能】
v1.22 更新 20251114
图片抓取:增加原生抓图,即原网页右下角增加照相机图标,点击后在原网页进行图片下载操作,设置最小宽度和最小高度,支持全选和全不选,支持图片ZIP打包下载(跨域跳过),支持新标签右键下载(支持跨域)。原生网页操作,可以体验一下。默认最小宽度100和最小高度为290,可调整使用,如100
v1.21 更新 20251111
密码管理:修正密码填充失败问题
v1.20 更新 20251110
插件目录:目录固定为“网页多插件平台”,以后只更新版本号,若只刷新插件,可保留插件本地数据。
媒体抓取:媒体链接下载,增加选择和导出为文本文件
密码管理:同域名网站密码实现一键填充,填充后自动关闭插件窗口。
v1.19 更新 20251110
媒体抓取:增加音频和视频链接抓取,包括m3u8 m3u mp3 mp4 m4a webm ogg wav等
网页链接:增加多个关键词搜索,下载支持csv和excel格式
密码管理:增加自动登录,即自动匹配当前网站域名的用户密码,点击填充即可。
功能说明
- 媒体抓取,增加音频和视频链接抓取,包括m3u8 m3u mp3 mp4 m4a webm ogg wav等
- 网页链接,增加多个关键词搜索,下载支持csv和excel格式
- 密码管理,增加自动登录,即自动匹配当前网站域名的用户密码,点击填充即可。
关键代码
// 在页面中查找M3U8链接的函数(将被注入到目标页面)
function findM3U8Links() {
const m3u8Links = new Set();
// 查找所有可能的M3U8链接来源
const sources = [
// 1. 查找<script>标签中的M3U8链接
...Array.from(document.scripts).map(script => script.innerHTML),
// 2. 查找JSON数据
...Array.from(document.querySelectorAll('*')).map(el => el.innerHTML),
// 3. 查找视频标签
...Array.from(document.querySelectorAll('video source')).map(source => source.src),
// 4. 查找所有链接
...Array.from(document.querySelectorAll('a')).map(a => a.href)
];
...
// 在所有来源中搜索媒体链接
const mediaRegex = /https?:\/\/[^\s"']+\.(?:mp3|mp4|m4a|m3u|webm|ogg|wav)(?:\?[^\s"']*)?/gi;
sources.forEach(source => {
if (typeof source === 'string') {
matches = source.match(mediaRegex);
if (matches) {
matches.forEach(match => m3u8Links.add(match));
}
}
});
...
// 抓取链接的函数(将在目标页面中执行)
function scrapeLinks(minTitleLength, domainFilterValue, currentDomain, chineseOnly, chineseRequired, minChineseLength, keywords, searchTitle, searchUrl, matchAll, caseSensitive) {
try {
const links = Array.from(document.getElementsByTagName('a'));
const results = [];
const currentPageDomain = window.location.hostname;
links.forEach((link, index) => {
const title = link.textContent.trim();
const href = link.href;
// 只保留标题长度大于等于指定值的链接
if (title.length >= minTitleLength && href && href.startsWith('http')) {
const url = new URL(href);
const linkDomain = url.hostname;
...
// 关键词筛选
if (includeLink && keywords && keywords.length > 0) {
let titleMatch = false;
let urlMatch = false;
if (searchTitle) {
titleMatch = matchKeywords(title, keywords, matchAll, caseSensitive);
}
if (searchUrl) {
urlMatch = matchKeywords(href, keywords, matchAll, caseSensitive);
}
// 根据搜索选项决定是否包含该链接
if (searchTitle && searchUrl) {
includeLink = titleMatch || urlMatch;
} else if (searchTitle) {
includeLink = titleMatch;
} else if (searchUrl) {
includeLink = urlMatch;
}
...
// 密码管理 页面加载完成后尝试自动填充
// 检查是否有保存的凭据用于当前网站
const domain = window.location.hostname;
chrome.storage.local.get(['passwordManagerAccounts', 'passwordManagerSettings'], function(result) {
const accounts = result.passwordManagerAccounts || [];
const settings = result.passwordManagerSettings || {};
// 如果启用了自动填充
if (settings.autoFill) {
// 查找匹配的账号
const matchingAccounts = accounts.filter(account =>
account.accountName.toLowerCase().includes(domain.toLowerCase()) ||
domain.toLowerCase().includes(account.accountName.toLowerCase())
);
if (matchingAccounts.length > 0) {
// 使用第一个匹配的账号
const account = matchingAccounts[0];
setTimeout(() => {
fillLoginForm(account.username, account.password);
}, 500);
...
安装方法
插件直接解压,扩展程序中,加载未打包的扩展程序,选择解压目录即可
附件
详见附件,解压密码:52pojie
欢迎试用。
|