diff --git a/markdown-toc-code/demo.html b/demo/demo.html
similarity index 100%
rename from markdown-toc-code/demo.html
rename to demo/demo.html
diff --git a/markdown-toc-code/background.html b/markdown-toc-code/background.html
deleted file mode 100644
index e69de29..0000000
diff --git a/markdown-toc-code/demo2.html b/markdown-toc-code/demo2.html
deleted file mode 100644
index 5c5dbd3..0000000
--- a/markdown-toc-code/demo2.html
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
- div width resize
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/markdown-toc-code/demo3.html b/markdown-toc-code/demo3.html
deleted file mode 100644
index 9419979..0000000
--- a/markdown-toc-code/demo3.html
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
- div width resize
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/markdown-toc-code/js/content-script.1.js b/markdown-toc-code/js/content-script.1.js
deleted file mode 100644
index 48f9dcf..0000000
--- a/markdown-toc-code/js/content-script.1.js
+++ /dev/null
@@ -1,90 +0,0 @@
-const $ = function (str) {
- return document.querySelector(str);
-};
-
-function addStyle(obj, atrr) {
- for (var pro in atrr) {
- obj.style[pro] = atrr[pro];
- }
-}
-
-setTimeout(function () {
- var git_reg = /[https://github.com].*/;
- if (git_reg.test(document.URL)) {
- var _readme = $('article');
- var data = _readme.querySelectorAll('h1');
- // var data = _readme.querySelectorAll('h1,h2,h3,h4,h5,h6');
- var div = init(data);
- document.body.appendChild(div);
- }
-}, 1000)
-
-// 初始化
-function init(list) {
-
- var toc = document.createElement("ul");
- addStyle(toc, {
- "position": "fixed",
- "margin-right": "20px",
- "padding": "20px",
- "border-radius": "3px",
- "width": "400px",
- "height": "85%",
- "min-height": "200px",
- "z-index": 999,
- "left": "10px",
- "top": "70px",
- "bottom": "20px",
- "overflow-x": "hidden",
- "overflow": "auto",
- // "background": "gainsboro",
- "border": "1px solid #d1d5da",
- })
- var stack = new Array();
-
-
-
- for (var i = 0; i < list.length; i++) {
- var header = list[i];
-
- console.log(header);
- // console.log(header.a.href);
- var level = parseInt(header.tagName.replace('H', ''), 10) - 1;
- // 通过两个where循环对栈进行调整,确保stack中标题级数与当前标题级数相同
- while (stack.length < level) {
- stack.push(0);
- }
- while (stack.length > level) {
- stack.pop();
- }
- // debugger;
-
-
- // 最小一级标题标号步进 + 1
- stack[stack.length - 1]++;
- // 生成标题标号( 1.1,1.2.. )
- var index = stack.join(".")
- // 生成标题ID
- var id = "title" + index;
- header.setAttribute('id', id);
- var li = document.createElement("li");
- addStyle(li, {
- "listStyle": "none",
- })
- toc.appendChild(li);
- var a = document.createElement("a");
- addStyle(a, {
- "color": "#0366d6",
- "textOverflow ": "ellipsis"
- })
- // 为目录项设置链接
- a.setAttribute("href", "#" + id)
- // 目录项文本前面放置缩进空格
- a.innerHTML = new Array(level * 4).join(' ') + index + new Array(2).join(' ') + header.textContent;
- toc.lastChild.appendChild(a);
-
- }
- return toc;
-
-}
-
diff --git a/markdown-toc-code/js/content-script.js b/markdown-toc-code/js/content-script.js
index ca64153..a8c1392 100644
--- a/markdown-toc-code/js/content-script.js
+++ b/markdown-toc-code/js/content-script.js
@@ -1,281 +1,312 @@
-const $ = function (str) {
- return document.querySelector(str);
+// doc 获取
+var _$ = function(str, dom, isAll) {
+ var DOM = dom || document;
+ return DOM[`querySelector${isAll ? "All" : ""}`](str);
};
-function addStyle(obj, atrr) {
- for (var pro in atrr) {
- obj.style[pro] = atrr[pro];
- }
-}
+// style 添加
+var addStyle = function(obj, atrr) {
+ for (var pro in atrr) {
+ obj.style[pro] = atrr[pro];
+ }
+};
+
+// 全局变量
+var $container, $repoheadDetailsContainer, $jsRepoNav, containerClient;
// Github页面 过去一秒后开始加载元素 渲染toc目录
-// setTimeout(function () {
-// var git_reg = /[https://github.com].*/;
-// if (git_reg.test(document.URL)) {
-// var _readme = $('article');
-// var data = _readme.querySelectorAll('h1,h2,h3');
-// var div = init(data);
-// document.body.appendChild(div);
-// }
-// // alert($(window).width);
-// console.log(document.getElementById('div_right_bar'));
-// bindResize(document.getElementById('div_right_bar'));
-// // 因为你这里你根本不知道页面结构到底加载好了没 资源 z加载enme完毕了吗
-// document.getElementsByTagName('html')[0].style.marginLeft = "350px";
-// }, 1000)
-//看看 这里执行了吗
-let $container;
-let $repoheadDetailsContainer;
-let $jsRepoNav;
-let containerClient;
-const domInit = function(){
- console.log(new Date().getTime(),'初始化开始')
- var git_reg = /[https://github.com].*/;
- if (git_reg.test(document.URL)) {
- var _readme = $('article');
- var data = _readme.querySelectorAll('h1,h2,h3');
- var div = init(data);
- document.body.appendChild(div);
- }
- // alert($(window).width);
- console.log(document.getElementById('div_right_bar'));
- bindResize(document.getElementById('div_right_bar'));
- const $idHtml = document.querySelector('#js-repo-pjax-container');
- $container = $idHtml.children[1];
- $repoheadDetailsContainer = document.querySelector('.repohead-details-container');
- $jsRepoNav = document.querySelector('.js-repo-nav');
- containerClient = $container.getClientRects()[0];
+var domInit = function() {
+ var _readme = _$("article");
+ if (_readme) {
+ var data = _$("h1,h2,h3", _readme, true);
+ var div = init(data);
+ document.body.appendChild(div);
+
+ bindResize(_$("#div_right_bar"));
+ var $idHtml = _$("#js-repo-pjax-container");
+ $container = $idHtml.children[1];
+ containerClient = $container.getClientRects()[0];
+ $repoheadDetailsContainer = _$(".repohead-details-container");
+ $jsRepoNav = _$(".js-repo-nav");
// 因为你这里你根本不知道页面结构到底加载好了没 资源 z加载enme完毕了吗
- // document.querySelector('.Header').style.paddingLeft = '350px';
initTocBar(350);
- // document.querySelector('#js-repo-pjax-container').style.paddingLeft = '350px';
-
-
- // document.getElementsByTagName('html')[0].style.marginLeft = "350px";
-}
-document.addEventListener('DOMContentLoaded',domInit,false);
+ }
+};
+var pluginInit = function() {
+ domInit();
+ // 处理单页跳转,页面未重新加载问题
+ var github_progress = _$("#js-pjax-loader-bar");
+ var observer = new MutationObserver(function(mutations, observer) {
+ mutations.forEach(function(mutation) {
+ if (mutation.target.getAttribute("class").indexOf("is-loading") === -1) {
+ removeArtice();
+ domInit();
+ }
+ });
+ });
+ observer.observe(github_progress, { attributeFilter: ["class"] });
+};
-function initTocBar(initWidth){
- var els = document.getElementById('toc').style;
+var removeArtice = function() {
+ var toc = _$("#toc");
+ if (toc) {
+ document.body.removeChild(toc);
+ }
+};
- //宇宙超级无敌运算中...
- let w = document.body.clientWidth;
- let w2 = initWidth + 'px';
+document.addEventListener("DOMContentLoaded", pluginInit, false);
+
+function initTocBar(initWidth) {
+ var els = _$("#toc").style;
+
+ //宇宙超级无敌运算中...
+ var w2 = initWidth + "px";
+
+ var minWidth = 200;
+ var moveWidth = parseInt(initWidth);
+ if (moveWidth < 200) {
+ return;
+ }
+ var $header = _$(".Header");
+
+ if (moveWidth > minWidth && initWidth > containerClient.left) {
+ document.getElementsByTagName("html")[0].style.marginLeft = w2;
+ $header.style.paddingLeft = 0 + "px";
+ $container.style.marginLeft = "10px";
+ $repoheadDetailsContainer.style.marginLeft = "10px";
+ $jsRepoNav.style.marginLeft = "10px";
+ } else {
+ $header.style.paddingLeft = moveWidth + "px";
+ document.getElementsByTagName("html")[0].style.marginLeft = 0;
+ $container.style.marginLeft = "auto";
+ $repoheadDetailsContainer.style.marginLeft = "auto";
+ $jsRepoNav.style.marginLeft = "auto";
+ }
+ els.width = initTocBar + "px";
+}
- var minWidth = 200;
- var moveWidth = parseInt(initWidth);
- if(moveWidth < 200){
- return;
+// 这里是画出 toc的逻辑
+function init(list) {
+ var toc = document.createElement("div");
+ toc.setAttribute("class", "toc");
+ toc.setAttribute("id", "toc");
+
+ var div_top = document.createElement("div");
+ addStyle(div_top, { width: "100%" });
+ div_top.setAttribute("id", "top");
+
+ var div_toc = document.createElement("div");
+ div_toc.setAttribute("id", "div_toc");
+ div_toc.setAttribute("class", "div_toc");
+
+ var div_right_bar = document.createElement("div"); // 这是一个 拖动bar
+ div_right_bar.setAttribute("id", "div_right_bar");
+ div_right_bar.setAttribute("class", "div_right_bar");
+ div_right_bar.textContent = "";
+
+ var firstLevel = 0;
+ var isGetFisrtLevel = false;
+
+ for (var i = 0; i < list.length; i++) {
+ var header = list[i];
+
+ var hreftagname = header.firstElementChild.hash;
+ var level = parseInt(header.tagName.replace("H", ""), 10);
+
+ if (!isGetFisrtLevel) {
+ firstLevel = level;
+ isGetFisrtLevel = true;
+
+ var header_p = document.createElement("li");
+ header_p.textContent = "GitHub Markdown TOC";
+ addStyle(header_p, {
+ listStyle: "none",
+ "font-size": "20px",
+ "margin-bottom": "10px"
+ });
+
+ var gotop_li = document.createElement("li");
+ var gotop_li = document.createElement("li");
+ addStyle(gotop_li, { listStyle: "none" });
+ var gotop_a = document.createElement("a");
+ addStyle(gotop_a, {
+ color: "#0366d6",
+ "textOverflow ": "ellipsis",
+ "font-weight": "bold"
+ });
+ gotop_a.innerHTML = "▲ GO TOP";
+ gotop_a.setAttribute("href", "#");
+ div_toc.appendChild(header_p);
+
+ div_toc.appendChild(gotop_li);
+ div_toc.lastChild.appendChild(gotop_a);
}
- var $header = document.querySelector('.Header');
-
-
- if(moveWidth > minWidth && initWidth > containerClient.left){
- document.getElementsByTagName('html')[0].style.marginLeft = w2;
- $header.style.paddingLeft = 0 + 'px';
- // $container.style.marginLeft = '10px';
- $container.style.marginLeft = '10px';
- $repoheadDetailsContainer.style.marginLeft = '10px';
- $jsRepoNav.style.marginLeft = '10px';
- }else{
- $header.style.paddingLeft = moveWidth + 'px';
- document.getElementsByTagName('html')[0].style.marginLeft = 0;
- $container.style.marginLeft = 'auto';
- $repoheadDetailsContainer.style.marginLeft = 'auto';
- $jsRepoNav.style.marginLeft = 'auto';
+
+ var li = document.createElement("li");
+ addStyle(li, { listStyle: "none" });
+
+ var a = document.createElement("a");
+ addStyle(a, { color: "#0366d6", "textOverflow ": "ellipsis" });
+
+ // a.innerHTML = level + header.textContent;
+ if (level == firstLevel) {
+ a.innerHTML = header.textContent;
+ addStyle(a, { "font-weight": "bold" });
+ } else {
+ a.innerHTML = new Array(level * 2).join(" ") + header.textContent;
}
- els.width = initTocBar + 'px';
+ a.setAttribute("href", hreftagname);
+ // li.appendChild(a);
+ div_toc.appendChild(li);
+ div_toc.lastChild.appendChild(a);
+ }
+
+ toc.appendChild(div_top);
+ toc.appendChild(div_toc);
+ toc.appendChild(div_right_bar);
+
+ var div_shrink = document.createElement("div");
+ div_shrink.innerHTML =
+ '';
+ addStyle(div_shrink, {
+ width: "32px",
+ height: "32px",
+ display: "inline-block",
+ position: "absolute",
+ bottom: "10px"
+ });
+ var isExpand = conversionBoolean(getCookie("github-markdown-toc-isShow"));
+ div_shrink.addEventListener("click", function() {
+ var div = _$("#toc"),
+ w = div.clientWidth || div.offsetWidth;
+ isExpand
+ ? addStyle(div, {
+ transform: "translateX(-" + w + "px)"
+ })
+ : addStyle(div, { transform: "translateX(0px)" });
+ resetLayout(isExpand, w);
+ isExpand = !isExpand;
+ setCookie("github-markdown-toc-isShow", isExpand);
+ });
+ if (isExpand == false) {
+ toc.setAttribute("style", "transform: translateX(-350px)");
+ }
+ toc.appendChild(div_shrink);
+ return toc;
}
+var resetLayout = function(isShow, w) {
+ var $header = _$(".Header"),
+ htmlMarginLeft = "0px",
+ headerPaddingLeft = "0px",
+ containerMarginLeft = "auto",
+ rdContainerMarginLeft = "auto",
+ jsRepoNavMarginLeft = "auto";
+ if (!isShow) {
+ if (w > containerClient.left) {
+ htmlMarginLeft = w + "px";
+ containerMarginLeft = "10px";
+ rdContainerMarginLeft = "10px";
+ jsRepoNavMarginLeft = "10px";
+ } else {
+ headerPaddingLeft = w + "px";
+ }
+ }
+ document.getElementsByTagName("html")[0].style.marginLeft = htmlMarginLeft;
+ $header.style.paddingLeft = headerPaddingLeft;
+ $container.style.marginLeft = containerMarginLeft;
+ $repoheadDetailsContainer.style.marginLeft = rdContainerMarginLeft;
+ $jsRepoNav.style.marginLeft = jsRepoNavMarginLeft;
+};
+var conversionBoolean = function(val) {
+ var obj = {
+ true: true,
+ false: false
+ };
+ return obj[val];
+};
-// 这里是画出 toc的逻辑
-function init(list) {
- var toc = document.createElement("div");
- toc.setAttribute("class", "toc");
- toc.setAttribute("id", "toc");
-
- var div_top = document.createElement("div");
- addStyle(div_top, {"width": "100%"});
- div_top.setAttribute('id', "top");
-
- var div_toc = document.createElement("div");
- div_toc.setAttribute('id', "div_toc");
- div_toc.setAttribute("class", "div_toc");
-
- var div_right_bar = document.createElement("div"); // 这是一个 拖动bar
- div_right_bar.setAttribute('id', "div_right_bar");
- div_right_bar.setAttribute("class", "div_right_bar");
- div_right_bar.textContent = "";
-
-
-
- var toc_ul = document.createElement("ul");
-
- var firstLevel = 0;
- var isGetFisrtLevel = false;
-
- for (var i = 0; i < list.length; i++) {
- var header = list[i];
-
- var hreftagname = header.firstElementChild.hash;
- var level = parseInt(header.tagName.replace('H', ''), 10);
-
- if(!isGetFisrtLevel){
- firstLevel = level;
- isGetFisrtLevel = true;
-
- var header_p = document.createElement("li");
- header_p.textContent = "GitHub Markdown TOC";
- addStyle(header_p, {"listStyle": "none","font-size":"20px","margin-bottom":"10px"});
-
- var gotop_li = document.createElement("li");
- var gotop_li = document.createElement("li");
- addStyle(gotop_li, {"listStyle": "none"});
- var gotop_a = document.createElement("a");
- addStyle(gotop_a, {"color": "#0366d6","textOverflow ": "ellipsis","font-weight":"bold"});
- gotop_a.innerHTML = "▲ GO TOP";
- gotop_a.setAttribute("href", "#");
- div_toc.appendChild(header_p);
-
- div_toc.appendChild(gotop_li);
- div_toc.lastChild.appendChild(gotop_a);
- }
-
- var li = document.createElement("li");
- addStyle(li, {"listStyle": "none"});
-
- var a = document.createElement("a");
- addStyle(a, {"color": "#0366d6","textOverflow ": "ellipsis"});
-
- // a.innerHTML = level + header.textContent;
- if( level == firstLevel ){
- a.innerHTML = header.textContent;
- addStyle(a, {"font-weight":"bold"});
- }
- else{
- a.innerHTML = new Array(level * 2).join(' ') + header.textContent;
- }
- a.setAttribute("href", hreftagname);
- // li.appendChild(a);
- div_toc.appendChild(li);
- div_toc.lastChild.appendChild(a);
- }
+var setCookie = function(name, value) {
+ document.cookie = name + "=" + escape(value);
+};
- toc.appendChild(div_top);
- toc.appendChild(div_toc);
- toc.appendChild(div_right_bar);
- return toc;
-}
+var getCookie = function(name) {
+ var arr,
+ reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
+ if ((arr = document.cookie.match(reg))) return unescape(arr[2]);
+ else return null;
+};
// 这里是绑定resize事件的方法
function bindResize(el) {
- //初始化参数
- var els = document.getElementById('toc').style;
- //鼠标的 X 和 Y 轴坐标
- x = 0;
- //邪恶的食指
- el.onmousedown = function(e){
- //按下元素后,计算当前鼠标与对象计算后的坐标
- x = e.clientX - el.offsetWidth,
- y = e.clientY - el.offsetHeight;
- console.log(x);
- //在支持 setCapture 做些东东
- el.setCapture ? (
- //捕捉焦点
- el.setCapture(),
+ //初始化参数
+ var els = _$("#toc").style;
+ //鼠标的 X 和 Y 轴坐标
+ x = 0;
+ //邪恶的食指
+ el.onmousedown = function(e) {
+ //按下元素后,计算当前鼠标与对象计算后的坐标
+ (x = e.clientX - el.offsetWidth), (y = e.clientY - el.offsetHeight);
+ //在支持 setCapture 做些东东
+ el.setCapture
+ ? //捕捉焦点
+ (el.setCapture(),
//设置事件
- el.onmousemove = function (ev)
- {
- mouseMove(ev || event);
- },
- el.onmouseup = mouseUp
- ) : (
- function(){
- document.addEventListener('mousemove',mouseMove,false);
- document.addEventListener('mouseup',mouseUp,false);
- }()
- );
- //防止默认事件发生
- e.preventDefault();
- }
-
- //移动事件
- function mouseMove(e) {
- console.log(e);
- // document.querySelector('#js-repo-pjax-container').style.paddingLeft = "0px";
- // console.log
- //宇宙超级无敌运算中...
- let w = document.body.clientWidth;
- let w2 = e.clientX + 'px';
- // haha xiecuole
- // els.width = e.clientX - x + 'px';
- // 好的你来操作
-
- // if(e.clientX && e.clientX > (w-980)/2 ){
- // document.getElementsByTagName('html')[0].style.marginLeft = w2;
- // }else{
- // document.getElementsByTagName('html')[0].style.marginLeft = '0px';
- // }
- // console.log(e.clientX);
- // if(e.clientX > 100){
-
- // }
- // console.log("e.clientX " + e.clientX);
-
-
- // var readmeWidth = document.getElementById("readme").clientWidth;
- // var maxWidth = document.getElementById("readme").clientWidth * 0.8;
- var minWidth = 200;
- var moveWidth = parseInt(e.clientX);
- if(moveWidth < 200){
- return;
- }
- var $header = document.querySelector('.Header');
-
-
- if(moveWidth > minWidth && e.clientX > containerClient.left){
- document.getElementsByTagName('html')[0].style.marginLeft = w2;
- $header.style.paddingLeft = 0 + 'px';
- // $container.style.marginLeft = '10px';
- $container.style.marginLeft = '10px';
- $repoheadDetailsContainer.style.marginLeft = '10px';
- $jsRepoNav.style.marginLeft = '10px';
- }else{
- $header.style.paddingLeft = moveWidth + 'px';
- document.getElementsByTagName('html')[0].style.marginLeft = 0;
- $container.style.marginLeft = 'auto';
- $repoheadDetailsContainer.style.marginLeft = 'auto';
- $jsRepoNav.style.marginLeft = 'auto';
- }
- els.width = e.clientX + 'px';
-
- return;
- if( moveWidth > minWidth && e.clientX > (w-980)/2 ){
- document.getElementsByTagName('html')[0].style.marginLeft = w2;
- $header.style.paddingLeft = 0 + 'px';
-
- }
-
-
- els.width = e.clientX + 'px';
+ (el.onmousemove = function(ev) {
+ mouseMove(ev || event);
+ }),
+ (el.onmouseup = mouseUp))
+ : (function() {
+ document.addEventListener("mousemove", mouseMove, false);
+ document.addEventListener("mouseup", mouseUp, false);
+ })();
+ //防止默认事件发生
+ e.preventDefault();
+ };
+
+ //移动事件
+ function mouseMove(e) {
+ //宇宙超级无敌运算中...
+ var w = document.body.clientWidth;
+ var w2 = e.clientX + "px";
+ var minWidth = 200;
+ var moveWidth = parseInt(e.clientX);
+ if (moveWidth < 200) {
+ return;
}
- //停止事件
- function mouseUp() {
- //在支持 releaseCapture 做些东东
- el.releaseCapture ? (
- //释放焦点
- el.releaseCapture(),
- //移除事件
- el.onmousemove = el.onmouseup = null
- ) : (
- function(){
- document.removeEventListener("mousemove", mouseMove);
- document.removeEventListener("mouseup", mouseUp);
- }()
- );
+ var $header = _$(".Header");
+
+ if (moveWidth > minWidth && e.clientX > containerClient.left) {
+ document.getElementsByTagName("html")[0].style.marginLeft = w2;
+ $header.style.paddingLeft = 0 + "px";
+ // $container.style.marginLeft = '10px';
+ $container.style.marginLeft = "10px";
+ $repoheadDetailsContainer.style.marginLeft = "10px";
+ $jsRepoNav.style.marginLeft = "10px";
+ } else {
+ $header.style.paddingLeft = moveWidth + "px";
+ document.getElementsByTagName("html")[0].style.marginLeft = 0;
+ $container.style.marginLeft = "auto";
+ $repoheadDetailsContainer.style.marginLeft = "auto";
+ $jsRepoNav.style.marginLeft = "auto";
}
-}
\ No newline at end of file
+ els.width = e.clientX + "px";
+ }
+ //停止事件
+ function mouseUp() {
+ //在支持 releaseCapture 做些东东
+ el.releaseCapture
+ ? //释放焦点
+ (el.releaseCapture(),
+ //移除事件
+ (el.onmousemove = el.onmouseup = null))
+ : (function() {
+ document.removeEventListener("mousemove", mouseMove);
+ document.removeEventListener("mouseup", mouseUp);
+ })();
+ }
+}
diff --git a/markdown-toc-code/manifest.json b/markdown-toc-code/manifest.json
index dee2243..4f69d44 100644
--- a/markdown-toc-code/manifest.json
+++ b/markdown-toc-code/manifest.json
@@ -3,20 +3,19 @@
"name": "GitHub-Markdown-TOC",
"description": "a markdown toc tool for GitHub Article",
"version": "0.0.1",
- "content_scripts":
- [
- {
- "matches": [""],
- "js": [ "js/content-script.js"],
- "css":["css/content.css"],
- "run_at": "document_start"
- }
- ],
- "background":{
- "script":["js/background.js"]
- },
+ "content_scripts": [
+ {
+ "matches": ["https://github.com/*"],
+ "js": ["js/content-script.js"],
+ "css": ["css/content.css"],
+ "run_at": "document_start"
+ }
+ ],
+ "background": {
+ "script": ["js/background.js"]
+ },
"browser_action": {
"default_icon": "img/logo.png",
"default_popup": "popup.html"
}
-}
\ No newline at end of file
+}
diff --git a/markdown-toc-code/manifest_back2.json b/markdown-toc-code/manifest_back2.json
deleted file mode 100644
index edf8c85..0000000
--- a/markdown-toc-code/manifest_back2.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "manifest_version": 2,
-
- "name": "GitHub-Markdown-TOC",
- "description": "a markdown toc tool for GitHub Article",
- "version": "0.0.1",
- "content_scripts": //用于配置注入页面中的脚本
- [
- {
- //"matches": ["http://*/*", "https://*/*"],
- // "" 表示匹配所有地址
- "matches": [""],
- // 多个JS按顺序注入
- "js": [ "js/content-script.js"],
- "css":["css/content.css"],
- // JS的注入可以随便一点,但是CSS的注意就要千万小心了,因为一不小心就可能影响全局样式
- // 代码注入的时间,可选值: "document_start", "document_end", or "document_idle",最后一个表示页面空闲时,默认document_idle
- "run_at": "document_start"
- }
- ],
- "background":{// 运行在chrome环境中的
- "script":["js/background.js"]
- },
- "browser_action": {
- "default_icon": "img/logo.png", // https://www.easyicon.net/1201150-menu_icon.html
- "default_popup": "popup.html"
- }
-}
\ No newline at end of file
diff --git a/markdown-toc-code/markdown-toc-code.crx b/markdown-toc-code/markdown-toc-code.crx
deleted file mode 100644
index 184b0bf..0000000
Binary files a/markdown-toc-code/markdown-toc-code.crx and /dev/null differ
diff --git a/markdown-toc-code/markdown-toc-code.zip b/markdown-toc-code/markdown-toc-code.zip
deleted file mode 100644
index 1281bd7..0000000
Binary files a/markdown-toc-code/markdown-toc-code.zip and /dev/null differ
diff --git a/markdown-toc-code/popup.html b/markdown-toc-code/popup.html
index 54467ea..e055956 100644
--- a/markdown-toc-code/popup.html
+++ b/markdown-toc-code/popup.html
@@ -1,22 +1,28 @@
-
-
-
-
-
-
-
-
GitHub-Markdown-TOC v0.0.2
-
-
Author:
- frank-lam,
- dxiaoqi,
- dzeze
-
Email: frank_lin@whu.edu.cn
-
from 2018/12/8
-
-
+
+
+
+
+
+
+
GitHub-Markdown-TOC v0.0.2
+
+
+ Author:
+ frank-lam,
+ dxiaoqi,
+ dzeze
+
Email: frank_lin@whu.edu.cn
+
+
from 2018/12/8
+
+
-
-