-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X-Frame-Options & iframe & CORS #23
Comments
https://cn.bing.com/?intlF=&ensearch=1
|
iframe & mdnhttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe const showDOM = (url = ``) => {
let iframeBox = $qs(`[data-img-box="empty-iframe-page-box"]`);
let no_data = `
<p data-no-data="p">
<span data-no-data="span">暂无数据</span>
</p>
`;
try {
if (url) {
let iframe = document.createElement(`iframe`);
iframe.src = url;
// sandbox
// srcdoc
iframe.style.height = `100%`;
iframe.style.width = `100%`;
iframe.style.minHeight = `300px`;
iframe.style.minWidth = `500px`;
iframe.setAttribute(`sandbox`, `allow-scripts`);
iframe.setAttribute(`sandbox`, `allow-scripts`);
iframe.setAttribute(`data-iframe`, `empty-iframe-page`);
iframe.setAttribute(`name`, `页面空模块`);
if (iframeBox) {
iframeBox.innerHTML = "";
iframeBox.insertAdjacentElement(`beforeend`, iframe);
}
}
} catch (err) {
// no data
iframeBox.innerHTML = "";
iframeBox.insertAdjacentHTML(`beforeend`, no_data);
throw new Error(`fetch image error`, err);
}
}; |
X-Frame-Optionshttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options#Syntax X-Frame-Options: deny
X-Frame-Options: sameorigin
X-Frame-Options: allow-from https://example.com/
|
CSS &
|
clearfixhttps://stackoverflow.com/questions/211383/what-methods-of-clearfix-can-i-use https://css-tricks.com/snippets/css/clear-fix/ .clear-fixed::after {
/* box-sizing: border-box; */
content: "";
display: block;
visibility: hidden;
overflow: hidden;
clear: both;
/* shit IE */
zoom: 1;
height: 0;
font-size: 0;
} css3 & vh & vwhttps://snook.ca/archives/html_and_css/vm-vh-units
https://caniuse.com/#search=Units |
code snippets{
"JavaScript ES6 React Template": {
"prefix": "js6r",
"body": [
"\"use strict\";",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * ",
" * @description $2",
" * @augments $3",
" * @example $4",
" * ",
" */",
"",
"const $2Generator = ($5datas = [], debug = false) => {",
" let result = ``;",
" // do something...",
" return $7result;",
"};",
"",
"",
"",
"export default $2;",
"",
"export {",
" $2,",
"};",
"",
],
"description": "JavaScript ES6 React Template & code snippets!"
}
} {
"CSS3 Template": {
"prefix": "c3t",
"body": [
"@charset \"UTf-8\";",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * ",
" * @description $1.css",
" * ",
" */",
"",
":root {",
" --cololr: #000;",
" --default-cololr: #fff;",
" --new-cololr: #0f0;",
"}",
],
"description": "CSS3 Template & code snippets!"
}
} |
水印
|
css bug<!DOCTYPE html>
<html>
<head>
<style>
p{
position: relative;
text-indent: 36px;
}
span{
position: absolute;
display: inline-block;
width: 16px;
height: 16px;
background: url("paper.gif") no-repeat;
color: #0f0;
background-color: #000;
top: 50%;
transform: translateY(-50%);
left: 20px
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p> <span>X</span>This page has an image as the background!</p>
</body>
</html>
|
scroll bughttps://preview.pro.ant.design/#/dashboard/analysis
|
minify html
new HtmlWebpackPlugin({
template: "./src/html/index.html",
filename: "./index.html",
chunks: ["index"],
// chunks: ["app", "main"],// load modules order ??? fifo
hash: true,
// minify: true,
minify: {
collapseWhitespace: true,
collapseInlineTagWhitespace: true,
},
}),
https://stackoverflow.com/questions/36031931/how-to-minify-html-templates-using-angular2-and-webpack |
// minify html
new HtmlWebpackPlugin({
template: "src/index.html",
chunksSortMode: "none",
minify: {
collapseWhitespace: true,
collapseInlineTagWhitespace: true,
removeTagWhitespace: true,
removeRedundantAttributes: true,
removeEmptyAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}
}), |
OKit's ok now
new HtmlWebpackPlugin({
// inject: false,
hash: true,
chunks: ["app"],
template: "./src/html/app.html",
filename: "./pages/app.html"
// filename: "./pages/[name].html"
}),
new HtmlWebpackPlugin({
// inject: false,
hash: true,
chunks: ["main"],
template: "./src/html/main.html",
filename: "./pages/main.html"
}),
new HtmlWebpackPlugin({
template: "./src/html/index.html",
filename: "./index.html",
chunks: ["index"],
// chunks: ["app", "main"],// load modules order ??? fifo
hash: true,
// minify: true,
minify: {
collapseWhitespace: true,
collapseInlineTagWhitespace: true,
},
}), |
X-Frame-Options
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
bug
The text was updated successfully, but these errors were encountered: