From 54bdcca2e05f711dde2ac92aa7cab3db5c8e9988 Mon Sep 17 00:00:00 2001 From: mingyang Date: Thu, 25 Feb 2021 19:23:09 +0800 Subject: [PATCH] change url to self build site, use querySelector instead of getElementsbyClassName --- view_github_code_in_vscode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view_github_code_in_vscode.js b/view_github_code_in_vscode.js index 21b85d0..2e251e1 100644 --- a/view_github_code_in_vscode.js +++ b/view_github_code_in_vscode.js @@ -10,14 +10,14 @@ (function() { 'use strict'; - var navi = document.getElementsByClassName('file-navigation') + var navi = document.querySelectorAll('.file-navigation') console.log(navi) if (navi.length > 0) { navi = navi[0] var node = document.createElement('a') node.className = 'btn btn-primary' node.style = 'margin-left: 0.5rem' - node.href = "https://github1s.com" + window.location.pathname + node.href = "https://githubvsc.zmy.pub" + window.location.pathname node.innerHTML = "View Code" node.target = "_blank" // var sep = navi.getElementsByClassName('flex-auto')[0]