-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Likhita4403/issue251
- Loading branch information
Showing
68 changed files
with
4,008 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// background.js | ||
|
||
// Listen for changes to bookmarks and update stored bookmarks | ||
chrome.bookmarks.onCreated.addListener(updateStoredBookmarks); | ||
chrome.bookmarks.onRemoved.addListener(updateStoredBookmarks); | ||
chrome.bookmarks.onChanged.addListener(updateStoredBookmarks); | ||
|
||
// Sync bookmarks across devices using Chrome Storage API | ||
function syncBookmarks() { | ||
chrome.bookmarks.getTree(function(bookmarkTreeNodes) { | ||
chrome.storage.sync.set({ 'bookmarks': bookmarkTreeNodes }, function() { | ||
console.log('Bookmarks synced successfully.'); | ||
}); | ||
}); | ||
} | ||
|
||
// Update stored bookmarks when changes occur | ||
function updateStoredBookmarks() { | ||
syncBookmarks(); | ||
} | ||
|
||
// Initialize bookmark syncing on extension install or update | ||
chrome.runtime.onInstalled.addListener(function(details) { | ||
if (details.reason === 'install' || details.reason === 'update') { | ||
syncBookmarks(); | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "Enhanced Bookmark Manager", | ||
"version": "1.0", | ||
"description": "An extension to enhance bookmark management in the browser.", | ||
"permissions": ["storage", "bookmarks"], | ||
"action": { | ||
"default_popup": "popup.html", | ||
"default_icon": "icon16.png" | ||
}, | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"icons": { | ||
"16": "icon16.png", | ||
"48": "icon48.png", | ||
"128": "icon128.png" | ||
}, | ||
"options_ui": { | ||
"page": "options.html", | ||
"open_in_tab": true | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Extension Options</title> | ||
</head> | ||
<body> | ||
<h1>Extension Options</h1> | ||
<p>This is where you can customize your extension settings.</p> | ||
|
||
<h2>Bookmark Display Options</h2> | ||
<label for="showTagsCheckbox"> | ||
<input type="checkbox" id="showTagsCheckbox"> Show tags with bookmarks | ||
</label> | ||
|
||
<h2>Sync Options</h2> | ||
<label for="syncCheckbox"> | ||
<input type="checkbox" id="syncCheckbox"> Enable bookmark syncing across devices | ||
</label> | ||
|
||
<h2>Notification Options</h2> | ||
<label for="notificationCheckbox"> | ||
<input type="checkbox" id="notificationCheckbox"> Enable notifications for new bookmarks | ||
</label> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Bookmark Manager</title> | ||
<script src="popup.js"></script> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Bookmark Manager</h1> | ||
<img src="icon128.png" alt="Extension Logo"> | ||
<input type="text" id="bookmarkUrl" placeholder="Enter URL"> | ||
<input type="text" id="bookmarkTags" placeholder="Enter tags (comma-separated)"> | ||
<button class="btn" id="addBookmark">Add Bookmark</button> | ||
<div id="status"></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
document.addEventListener('DOMContentLoaded', function() { | ||
document.getElementById('addBookmark').addEventListener('click', function() { | ||
var url = document.getElementById('bookmarkUrl').value; | ||
var tags = document.getElementById('bookmarkTags').value.split(',').map(tag => tag.trim()); | ||
|
||
chrome.bookmarks.create({ 'title': url, 'url': url }, function(newBookmark) { | ||
chrome.storage.sync.get('bookmarks', function(result) { | ||
var bookmarks = result.bookmarks || []; | ||
bookmarks.push({ id: newBookmark.id, url: url, tags: tags }); | ||
chrome.storage.sync.set({ 'bookmarks': bookmarks }, function() { | ||
document.getElementById('status').textContent = 'Bookmark added successfully.'; | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* styles.css */ | ||
.container { | ||
text-align: center; | ||
padding: 20px; | ||
} | ||
|
||
.btn { | ||
background-color: #007bff; | ||
color: #fff; | ||
border: none; | ||
padding: 10px 20px; | ||
font-size: 16px; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
} | ||
|
||
.btn:hover { | ||
background-color: #0056b3; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
body{ | ||
background-color: aliceblue; | ||
} | ||
*{ | ||
margin:0; | ||
padding:0; | ||
box-sizing:border-box; | ||
background-color: #ecf0f3; | ||
font-family: sans-serif; | ||
outline:none; | ||
} | ||
.container{ | ||
height:100vh; | ||
display:flex; | ||
justify-content:center; | ||
align-items:center; | ||
} | ||
.calci{ | ||
padding:15px; | ||
border-radius:30px; | ||
display:grid; | ||
grid-template-columns: repeat(4,68px); | ||
box-shadow: inset 5px 5px 12px #ffffff, | ||
5px 5px 12px rgba(0,0,0,.16); | ||
} | ||
input{ | ||
grid-column:span 4 ; | ||
height:60px; | ||
width:250px; | ||
background-color: #ecf0f3; | ||
box-shadow: inset -5px -5px 12px #ffffff, | ||
5px 5px 12px rgba(0,0,0,.16); | ||
border:none; | ||
border-radius:30px; | ||
font-size: 50px; | ||
text-align: end; | ||
margin:auto; | ||
margin-top:40px; | ||
margin-bottom:30px; | ||
padding:20px; | ||
color:rgba(70,70,70); | ||
|
||
} | ||
input:hover{ | ||
background-color: aqua; | ||
} | ||
button{ | ||
height:48px; | ||
width:48px; | ||
background-color: #ecf0f3; | ||
box-shadow: inset -5px -5px 12px #ffffff, | ||
5px 5px 12px rgba(0,0,0,.16); | ||
border:none; | ||
border-radius:30px; | ||
margin:8px; | ||
font-size: 15px; | ||
} | ||
.equal{ | ||
width:115px; | ||
border-radius: 40px; | ||
background-color:#ecf0f3; | ||
box-shadow: inset -5px -5px 12px #ffffff, | ||
5px 5px 12px rgba(0,0,0,.16); | ||
} | ||
button:hover{ | ||
background-color:aqua; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="calci.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="calci"> | ||
<input type="text" placeholder="0" id="output"> | ||
<button onclick="Clear()">C</button> | ||
<button onclick="del()">DEL</button> | ||
<button onclick="display('%')">%</button> | ||
<button onclick="display('/')">/</button> | ||
<button onclick="display('7')">7</button> | ||
<button onclick="display('8')">8</button> | ||
<button onclick="display('9')">9</button> | ||
<button onclick="display('+')">+</button> | ||
<button onclick="display('4')">4</button> | ||
<button onclick="display('5')">5</button> | ||
<button onclick="display('6')">6</button> | ||
<button onclick="display('-')">-</button> | ||
<button onclick="display('1')">1</button> | ||
<button onclick="display('2')">2</button> | ||
<button onclick="display('3')">3</button> | ||
<button onclick="display('*')">*</button> | ||
<button onclick="display('0')">0</button> | ||
<button onclick="display('00')">00</button> | ||
<button onclick="caliculate('=')" class="equal">=</button> | ||
|
||
</div> | ||
</div> | ||
<script> | ||
let output=document.getElementById('output'); | ||
function display(num){ | ||
output.value+=num; | ||
} | ||
function caliculate(){ | ||
try{ | ||
output.value=eval(output.value); | ||
} | ||
catch(err){ | ||
alert('Invalid'); | ||
} | ||
} | ||
function Clear(){ | ||
output.value=""; | ||
} | ||
function del(){ | ||
output.value=output.value.slice(0,-1); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.