Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Geeky-cat authored Aug 4, 2020
1 parent eff9387 commit 3f1f626
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 0 deletions.
21 changes: 21 additions & 0 deletions background.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<link rel="stylesheet" href="style.css">
<script src="util.js"></script>
<div id="navbar">
<a class="active" href="background.html">MineP</a>
</div>

<div id="ctt">
<button id="mine">MineP</button>
<button id="cpy" style="float: right;">Copy</button>
<br>
<br>
<textarea id="tarea" >
</textarea>
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions jquery.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"manifest_version":2,
"name":"MineP",
"version":"0.1",
"content_scripts":[
{
"matches": [ "http://*/*", "https://*/*"] ,
"js":["pgen.js","jquery.js"]
}

],
"browser_action":{
"default_popup":"background.html"
}
}
26 changes: 26 additions & 0 deletions pgen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var send="";
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
pmine()

});

function pmine(sep){
var output=[]
var coll=document.getElementsByTagName("script");
var payloads="";
for(elem of coll){
if(elem.innerHTML!="")
payloads+=elem.innerHTML;
else{
var url="https://api.codetabs.com/v1/proxy/?quest="+elem.src
$.get(url,(data)=>{payloads+=data})
}
}
$( document ).ajaxStop(function(){
var res = payloads.match(/([a-z0-9-_]){1,100}/gi);
output=Array.from(new Set(res))
send=output.toString();
chrome.runtime.sendMessage(send);
});
}
40 changes: 40 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
body
{
width:400px;
height:300px;
margin:0;
}
#ctt
{
margin:10px;
}
#navbar {
overflow: hidden;
background-color: #333;
}

#navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}

#navbar a:hover {
background-color: #ddd;
color: black;
}

#navbar a.active {
background-color: #4CAF50;
color: white;
}
textarea {
width: 370px;
height: 200px;
resize: none;
white-space:pre;
}
20 changes: 20 additions & 0 deletions util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
window.onload=()=>{
document.getElementById("mine").addEventListener("click", get);
document.getElementById("cpy").addEventListener("click", ()=>{
document.querySelector("textarea").select();
document.execCommand('copy');
});
}
function get(){
document.getElementById('mine').disabled=true;
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, "pmine");
});
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
document.getElementById('mine').disabled=false;
request=request.split(',').join('\n');
document.getElementById("tarea").value=request;
});

}

0 comments on commit 3f1f626

Please sign in to comment.