Skip to content

Commit

Permalink
version 0.0.1 done
Browse files Browse the repository at this point in the history
  • Loading branch information
NoEgAm committed Jan 11, 2020
1 parent aebabbc commit 1351ee5
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src.pem
Binary file added ctx/leetcode-cn-to-com.v0.0.1.crx
Binary file not shown.
Binary file added src/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/jump.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function initJumpBtn() {
const toolsEle = document.getElementsByClassName('css-nj515r-Tools e171bd604')[0];
var btn = document.createElement('button');
btn.setAttribute('class', 'css-atw98h-Button e167268t1 cn-to-com-btn');
targetPath = window.location.pathname.replace(/(\/\w+\/[\w-]+)(\/\w+)+/g, '$1');
btn.innerHTML = `<span><a href="https://leetcode.com${targetPath}discuss/?currentPage=1&orderBy=most_votes" target="_blank">国际站高票讨论</a></span>`;
toolsEle.appendChild(btn);
}

function init() {
initJumpBtn();
}

window.addEventListener("load", init);
// Icons made by <a href="https://www.flaticon.com/authors/monkik" title="monkik">monkik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
36 changes: 36 additions & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "Leetcode cn to com Extension",
"description": "Go to global site with one click",
"author": "NoEgAm",
"version": "0.0.1",
"browser_action": {
"default_icon": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
},
"manifest_version": 2,
"commands": {
"_execute_browser_action": {
"suggested_key": {
"default": "Ctrl+Shift+F",
"mac": "MacCtrl+Shift+F"
}
}
},
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"content_scripts": [{
"matches": [
"https://leetcode-cn.com/problems/*"
],
"js": ["jump.js"]
}],
"permissions": [
"*://*.leetcode-cn.com/*"
]
}

0 comments on commit 1351ee5

Please sign in to comment.