Skip to content

Commit

Permalink
Add android support
Browse files Browse the repository at this point in the history
  • Loading branch information
davtur19 committed Oct 9, 2019
1 parent 518e8c7 commit bcf441e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 14 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ An extension to check if .git is exposed in visited websites

![ScreenShot](https://i.imgur.com/c9qq5zG.png)

# Download
[Firefox](https://addons.mozilla.org/it/firefox/addon/dotgit/)

[Chrome](https://chrome.google.com/webstore/detail/dotgit/pampamgoihgcedonnphgehgondkhikel)
#### Download: [Firefox](https://addons.mozilla.org/it/firefox/addon/dotgit/) | [Chrome](https://chrome.google.com/webstore/detail/dotgit/pampamgoihgcedonnphgehgondkhikel)
19 changes: 15 additions & 4 deletions dotgit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ const GIT_WELL_KNOW_PATHS = [
];


// Not supported on Firefox for Android
if (chrome.browserAction.setIcon) {
chrome.browserAction.setIcon({
path: {
32: "icons/dotgit-32.png"
}
});
}

function notification(title, message) {
chrome.notifications.create({
type: "basic",
Expand All @@ -60,10 +69,12 @@ function checkGit(url, visitedSite) {
// .git found
visitedSite.withExposedGit.push(url);
chrome.storage.local.set(visitedSite);

chrome.browserAction.setBadgeText({
text: visitedSite.withExposedGit.length.toString()
});
// Not supported on Firefox for Android
if (chrome.browserAction.setBadgeText) {
chrome.browserAction.setBadgeText({
text: visitedSite.withExposedGit.length.toString()
});
}

notification("Found an exposed .git", to_check);
}
Expand Down
3 changes: 1 addition & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "DotGit",
"version": "3.0",
"version": "3.1",
"description": "An extension to check if .git is exposed in visited websites",
"icons": {
"48": "icons/dotgit-48.png",
Expand All @@ -22,7 +22,6 @@
]
},
"browser_action": {
"default_icon": "icons/dotgit-32.png",
"default_title": "DotGit",
"default_popup": "popup/popup.html"
}
Expand Down
1 change: 0 additions & 1 deletion popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ body {

ul.collection {
max-height: 500px;
width: 350px;
overflow-y: auto;
margin: 7px;
}
Expand Down
1 change: 1 addition & 0 deletions popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title>DotGit</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../lib/materialize.min.css"/>
<link rel="stylesheet" href="icon.css">
<link rel="stylesheet" href="popup.css"/>
Expand Down
14 changes: 11 additions & 3 deletions popup/popup.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
const MAX_ITEMS = 100;
chrome.browserAction.setBadgeText({
text: ""
});

// Not supported on Firefox for Android
if (chrome.browserAction.setBadgeText) {
chrome.browserAction.setBadgeText({
text: ""
});
// set width for desktop devices
document.addEventListener('DOMContentLoaded', function () {
let test = document.getElementById("hostsFound").style.width = "380px";
console.log(test);
});
}

function addElements(element, array, callback, downloading) {

Expand Down

0 comments on commit bcf441e

Please sign in to comment.