手机适配

This commit is contained in:
O2bmm 2025-03-27 02:51:10 +08:00
parent 0b218bdf11
commit 72ea2bb565
7 changed files with 28 additions and 3 deletions

View File

@ -1,3 +1,16 @@
body {
.popupBody {
width: 100%;
}
.wrapper.options {
margin-right: 10px;
}
.m3u8_wrapper #mergeTs {
font-size: 2rem;
}
.newDownload {
width: 100%;
padding: 0 2rem;
}

View File

@ -54,6 +54,9 @@ function start() {
$("#autoClose").prop("checked", G.downAutoClose);
// $("#downActive").prop("checked", G.downActive);
$("#downStream").prop("checked", G.downStream);
if (G.isMobile) {
$(`<link rel="stylesheet" type="text/css" href="css/mobile.css">`).appendTo("head");
}
$(`<style>${G.css}</style>`).appendTo("head");
// 流式下载服务端
streamSaver.mitm = G.streamSaverConfig.url;

View File

@ -12,6 +12,9 @@ let _index = null; // 当前页面 tab index
const downloadData = localStorage.getItem('downloadData') ? JSON.parse(localStorage.getItem('downloadData')) : [];
awaitG(() => {
if (G.isMobile) {
$(`<link rel="stylesheet" type="text/css" href="css/mobile.css">`).appendTo("head");
}
$(`<style>${G.css}</style>`).appendTo("head");
// 获取当前标签信息
chrome.tabs.getCurrent(function (tabs) {

View File

@ -117,6 +117,9 @@ function init() {
_data.pageDOM = new DOMParser().parseFromString(result, 'text/html');
});
}
if (G.isMobile) {
$(`<link rel="stylesheet" type="text/css" href="css/mobile.css">`).appendTo("head");
}
// 自定义CSS
$(`<style>${G.css}</style>`).appendTo("head");

View File

@ -12,6 +12,9 @@ chrome.storage.sync.get(G.OptionLists, function (items) {
if (items.Ext === undefined || items.Type === undefined || items.Regex === undefined) {
location.reload();
}
if (G.isMobile) {
$(`<link rel="stylesheet" type="text/css" href="css/mobile.css">`).appendTo("head");
}
$(`<style>${items.css}</style>`).appendTo("head");
const $extList = $("#extList");
for (let key in items.Ext) {

View File

@ -34,7 +34,7 @@
</ul>
</nav>
<div class="wrapper">
<div class="wrapper options">
<!-- 抓取后缀 -->
<section id="anchorSuffix">

View File

@ -11,7 +11,7 @@
<script src="js/function.js"></script>
</head>
<body>
<body class="popupBody">
<div class="Tabs">
<div id="currentTab" class="TabButton flex Active">
<span data-i18n-outer="currentPage"></span>