userscript...
This commit is contained in:
@@ -113,7 +113,7 @@ const userscriptWebpack = (config, env) => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
config.entry = {
|
config.entry = {
|
||||||
index: paths.appSrc + "/userscriptOptions.js",
|
"kiss-translator-options": paths.appSrc + "/userscriptOptions.js",
|
||||||
"kiss-translator.user": paths.appSrc + "/userscript.js",
|
"kiss-translator.user": paths.appSrc + "/userscript.js",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -129,9 +129,9 @@ const userscriptWebpack = (config, env) => {
|
|||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
inject: true,
|
inject: true,
|
||||||
chunks: ["index"],
|
chunks: ["kiss-translator-options"],
|
||||||
template: paths.appHtml,
|
template: paths.appHtml,
|
||||||
filename: "index.html",
|
filename: "kiss-translator-options.html",
|
||||||
}),
|
}),
|
||||||
new webpack.BannerPlugin({
|
new webpack.BannerPlugin({
|
||||||
banner,
|
banner,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { Translator } from "./libs/translator";
|
|||||||
*/
|
*/
|
||||||
(async () => {
|
(async () => {
|
||||||
// 设置页面
|
// 设置页面
|
||||||
if (document.location.href.includes("localhost:3000")) {
|
if (document.location.href.includes("kiss-translator-options")) {
|
||||||
const root = ReactDOM.createRoot(document.getElementById("root"));
|
const root = ReactDOM.createRoot(document.getElementById("root"));
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ const App = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ textAlign: "center" }}>
|
<div style={{ textAlign: "center" }}>
|
||||||
<p>KISS Translator userscript is disabled at this browser!</p>
|
<p>
|
||||||
|
<a href={process.env.REACT_APP_HOMEPAGE}>KISS Translator</a> Script not
|
||||||
|
installed or disabled!
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href={process.env.REACT_APP_HOMEPAGE}>Click here read more!</a>
|
<a href={process.env.REACT_APP_HOMEPAGE}>Click here read more!</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user