Skip to content

Commit 1162b53

Browse files
committed
手机不配?
1 parent 4df0a11 commit 1162b53

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

Writerside/cfg/buildprofiles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<locale-code>zh-CN</locale-code>
1616
<noindex-content>false</noindex-content>
1717
<include-in-head>head-script.html</include-in-head>
18-
<include-after-body>after-body.html</include-after-body>
18+
<!-- <include-after-body>after-body.html</include-after-body>-->
1919
<!-- <analytics-head-script-file>head-script.html</analytics-head-script-file>-->
2020
<algolia-id>VLLZ4JZE8Z</algolia-id>
2121
<algolia-index>doc</algolia-index>

Writerside/cfg/head-script.html

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
const elements = document.getElementsByTagName('article');
2323
if (elements && elements.length > 0) {
2424
const article = elements[0];
25-
const insDiv = document.createElement('div');
26-
insDiv.setAttribute('class', 'ins_div');
25+
//const insDiv = document.createElement('div');
26+
//insDiv.setAttribute('class', 'ins_div');
2727
const ins = document.createElement('ins');
2828
ins.setAttribute('class', 'adsbygoogle adsbygoogle_inline_ins');
2929
/*ins.setAttribute('style', 'display:block');*/
3030
ins.style.display = 'block';
3131
ins.setAttribute('data-ad-client', 'ca-pub-4062299174917944');
3232
ins.setAttribute('data-ad-slot', 'auto');
3333
ins.setAttribute('data-full-width-responsive', 'true');
34-
insDiv.appendChild(ins);
35-
article.appendChild(insDiv);
34+
//insDiv.appendChild(ins);
35+
article.appendChild(ins);
3636
then();
3737
}
3838
}
@@ -42,28 +42,6 @@
4242
}
4343

4444
/*横向广告*/
45-
if (/Mobi|Android|iPhone/i.test(navigator.userAgent)) {
46-
// 当前设备是移动设备
47-
// https://www.ruanyifeng.com/blog/2021/09/detecting-mobile-browser.html
48-
//try {
49-
//window.addEventListener('load',(event) => {
50-
// _addIns(() => {
51-
// _pushAd('after ins append.');
52-
// });
53-
//});
54-
//} catch (e) {
55-
// console.log('add event load failed.', e);
56-
//}
57-
window.onload=(event)=>{
58-
try{
59-
_addIns(() => {
60-
_pushAd('after ins append.');
61-
});
62-
} catch (e) {
63-
console.log('add ad failed.', e);
64-
}
65-
};
66-
} else {
6745
document.addEventListener("DOMContentLoaded", (event) => {
6846
try {
6947
_addIns(() => {
@@ -73,5 +51,4 @@
7351
});
7452
} catch(e) {console.log(e);}
7553
});
76-
}
7754
</script>

0 commit comments

Comments
 (0)