diff --git a/archive/1.2.6/LICENSE b/archive/1.2.6/LICENSE new file mode 100644 index 0000000..d3f8998 --- /dev/null +++ b/archive/1.2.6/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 ArcFox + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/archive/1.2.6/README.md b/archive/1.2.6/README.md new file mode 100644 index 0000000..347c84d --- /dev/null +++ b/archive/1.2.6/README.md @@ -0,0 +1,48 @@ +

+ + +

+ Logo +

+

ArcFox

+

+ Make firefox flow like arc +
+ Install » +
+

+

+ +# What is ArcFox? + + +ArcFox is a pack of firefox improvements that brings the appearance and some of the features of arc browser to firefox. Recently, The Browser Company © (the developers of arc browser) announced a windows version, so this project almost lost the reason to exist. But there still a linux version to be made and some people just like firefox and don't want to change. + +> NOTE: Arcfox is a side-project under development. + +I really recomend you to give a try on arc browser if you can. But we gonna do our best to make firefox nice as arc. + +# Installation +To use ArcFox you need to install arcfox-core and arcfox-theme (in this specific order). To proceed with the instalation, use the tutorial below. Using arcfox-core and arcfox-theme together is the best way to use ArcFox! + +### ArcFox-core Installation +To install arcfox-theme you need to download it on your firefox, we recommend you to download from the official addon store. To do that please follow this steps: + +- Download arcfox-core from this [link](https://addons.mozilla.org/en-US/firefox/addon/arcfox/) +- It should start to work just fine :D + +### ArcFox-Theme Installation +To install arcfox-theme you need to open your firefox configurations and turn style modification on. To do that please follow this steps: + +- Open "about:config" on firefox. +- On the search bar, search for "toolkit.legacyUserProfileCustomizations.stylesheets" and set the value to "true". +- Open "about:support" and click on the “Open Folder” button on the right of "Profile Folder" to open it. +- When the folder opens, search for a folder called "chrome", if you don't find it create one. +- Inside the "chrome" folder, drop the "userChrome.css" that you find on the releases. +- Restart firefox. + +# Support +If you have any problems you can open a issue on this repository or contact the developer [here](https://discord.gg/VRBVsjJ7NQ) + +# License +Arcfox is distributed under [MIT License](/LICENSE). diff --git a/archive/1.2.6/core/icon.png b/archive/1.2.6/core/icon.png new file mode 100644 index 0000000..352f57d Binary files /dev/null and b/archive/1.2.6/core/icon.png differ diff --git a/archive/1.2.6/core/manifest.json b/archive/1.2.6/core/manifest.json new file mode 100644 index 0000000..7d81f06 --- /dev/null +++ b/archive/1.2.6/core/manifest.json @@ -0,0 +1,29 @@ +{ + "manifest_version": 2, + "name": "ArcFox", + "version": "1.2.6", + "description": "Make firefox flow like arc.", + "icons": { + "16": "icon.png", + "48": "icon.png", + "98": "icon.png" + }, + "permissions": [ + "activeTab", + "tabs" + ], + "background": { + "scripts": ["src/sidebar.js"] + }, + "browser_action": { + "default_icon": { + "48": "icon.png" + } + }, + "sidebar_action": { + "default_panel": "src/sidebar.html", + "default_icon": { + "48": "icon.png" + } + } +} \ No newline at end of file diff --git a/archive/1.2.6/core/src/sidebar.html b/archive/1.2.6/core/src/sidebar.html new file mode 100644 index 0000000..dd269ea --- /dev/null +++ b/archive/1.2.6/core/src/sidebar.html @@ -0,0 +1,31 @@ + + + + + arcfox-core + + + + + + + + \ No newline at end of file diff --git a/archive/1.2.6/core/src/sidebar.js b/archive/1.2.6/core/src/sidebar.js new file mode 100644 index 0000000..8df5462 --- /dev/null +++ b/archive/1.2.6/core/src/sidebar.js @@ -0,0 +1,219 @@ +// Define variables +let tabs = []; +let activeTab = null; +const searchInput = document.getElementById("search-input"); +const tabList = document.getElementById("tab-list"); +const newTabButton = document.getElementById("new-tab-button"); +const settingsButton = document.getElementById("settings"); + +// Add event listeners +searchInput.addEventListener("keydown", function(event) { + if (event.keyCode === 13) { // Enter key + searchBar(); + } +}); + +newTabButton.addEventListener("click", function() { + browser.tabs.create({}); +}); + +// Browser-control +function handleBrowserControl(id) { + browser.tabs.query({active: true, currentWindow: true}).then((tabs) => { + let activeTab = tabs[0]; + if (id == 'back') { + browser.tabs.goBack(activeTab.id); + } else if (id == 'front') { + browser.tabs.goForward(activeTab.id); + } else if (id == 'refresh') { + browser.tabs.reload(activeTab.id); + } + }); + + browser.windows.getCurrent({populate: true}).then((window) => { + if (id == 'close') { + browser.windows.remove(window.id); + } else if (id == 'size') { + if (window.state === 'maximized') { + browser.windows.update(window.id, { state: 'normal' }); + } else { + browser.windows.update(window.id, { state: 'maximized' }); + } + } else if (id == 'hide') { + browser.windows.update(window.id, {state: "minimized"}); + } + }); +} + +document.getElementById("back").addEventListener("click", function() { + handleBrowserControl("back"); +}); + +document.getElementById("front").addEventListener("click", function() { + handleBrowserControl("front"); +}); + +document.getElementById("refresh").addEventListener("click", function() { + handleBrowserControl("refresh"); +}); + +document.getElementById("close").addEventListener("click", function() { + handleBrowserControl("close"); +}); + +document.getElementById("size").addEventListener("click", function() { + handleBrowserControl("size"); +}); + +document.getElementById("hide").addEventListener("click", function() { + handleBrowserControl("hide"); +}); + +document.getElementById("back").addEventListener("click", function() { + handleBrowserControl("back"); +}); + +document.getElementById("front").addEventListener("click", function() { + handleBrowserControl("front"); +}); + +document.getElementById("refresh").addEventListener("click", function() { + handleBrowserControl("refresh"); +}); + +document.addEventListener("click", (event) => { + if (event.target.classList.contains("browser-control-button")) { + handleButtonClick(event); + } +}); + +// Search +browser.tabs.onActivated.addListener(async () => { + const tab = await browser.tabs.query({ active: true, currentWindow: true }); + const currentUrl = tab[0].url; + searchInput.placeholder = currentUrl; +}); + +function updateSearchBar() { + browser.tabs.query({active: true, currentWindow: true}).then((tabs) => { + const currentUrl = tabs[0].url; + searchInput.placeholder = currentUrl; + }); +} + +setInterval(updateSearchBar, 50); + +browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { + if (changeInfo.url) { + const newTitle = performSearch(changeInfo.url) + browser.tabs.executeScript(tabId, { code: `document.title = '${newTitle}';` }); + renderTabs(tabs) + } +}); + +// Function to perform the search and return a new tab title +function performSearch(url) { + // Perform your search logic here... + // For example, you could extract keywords from the URL and use them to generate a new title + const keywords = extractKeywords(url); + const newTitle = `Search results for ${keywords}`; + + return newTitle; +} + +// Function to extract keywords from a URL +function extractKeywords(url) { + // Perform your keyword extraction logic here... + // For example, you could extract the query parameter from a search engine URL + const queryParam = new URLSearchParams(new URL(url).search).get('q'); + + return queryParam; +} + +function searchBar() { + const query = searchInput.value.trim(); + if (query === "") { + return; + } + browser.tabs.query({active: true, currentWindow: true}).then((tabs) => { + const currentTab = tabs[0]; + let url; + if (query.startsWith("http://") || query.startsWith("https://")) { + url = query; + } else if (query.endsWith(".com")) { + url = "https://" + query; + } else { + url = "https://www.google.com/search?q=" + encodeURIComponent(query); + } + browser.tabs.update(currentTab.id, {url: url}); + // Clear the search input + searchInput.value = ""; + // Update the search bar with the current URL + updateSearchBar(); + }); + // When clicked, clear the search input + searchInput.onclick = function() { + searchInput.placeholder = ""; + } +} + +// Render the tabs on sidebar +function renderTabs(tabsToRender) { + tabList.innerHTML = ""; + for (let i = 0; i < tabsToRender.length; i++) { + const tab = tabsToRender[i]; + const tabItem = document.createElement("li"); + tabItem.textContent = tab.title; + tabItem.classList.add("tab-item"); + if (tab === activeTab) { + tabItem.classList.add("active"); + } + const closeButton = document.createElement("button"); + closeButton.innerHTML = "x"; + closeButton.addEventListener("click", function(event) { + event.stopPropagation(); + closeTab(tab); + }); + tabItem.appendChild(closeButton); + tabItem.addEventListener("click", function() { + activateTab(tab); + }); + tabList.appendChild(tabItem); + } +} + +function activateTab(tab) { + activeTab = tab; + browser.tabs.update(tab.id, {active: true}); + renderTabs(tabs); +} + +function closeTab(tab) { + browser.tabs.remove(tab.id); + tabs = tabs.filter(function(t) { return t.id !== tab.id; }); + renderTabs(tabs); +} + +// Get tabs on extension startup +browser.tabs.query({}, function(results) { + tabs = results; + renderTabs(tabs); +}); + +// Listen for tab changes +browser.tabs.onCreated.addListener(function(tab) { + tabs.push(tab); + renderTabs(tabs); +}); +browser.tabs.onRemoved.addListener(function(tabId) { + tabs = tabs.filter(function(tab) { + return tab.id !== tabId; + }); + renderTabs(tabs); +}); +browser.tabs.onActivated.addListener(function(activeInfo) { + activeTab = tabs.find(function(tab) { + return tab.id === activeInfo.tabId; + }); + renderTabs(tabs); +}); \ No newline at end of file diff --git a/archive/1.2.6/core/src/style.css b/archive/1.2.6/core/src/style.css new file mode 100644 index 0000000..68c170d --- /dev/null +++ b/archive/1.2.6/core/src/style.css @@ -0,0 +1,149 @@ +body { + margin: 0; + padding: 0; + font-family: sans-serif; + width: 100%; +} + +#sidebar { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + background-color: #3b3f52; + box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3); + z-index: 9999; +} + +#sidebar::-webkit-scrollbar { + width: 0px; + height: 0px; +} + +#sidebar-header { + display: flex; + align-items: center; + flex-direction: column; + padding: 10px; + background-color: #3b3f52; + border-bottom: 1px solid #d0d0d0; +} + +#sidebar-header button { + border: none; + border-radius: 5px; + margin-bottom: 10px; + background: transparent; + color: white; +} + +#sidebar-header button i { + font-size: 15px; + color: #aac2d3; +} + +#sidebar-header button i:hover { + color: white; +} + +#page-control { + display: flex; + margin: 10px; + width: 100%; + flex-direction: row; + justify-content: flex-end; + gap: 3px; +} + +#action-buttons { + display: flex; + margin-right: auto; + gap: 3px; +} + +#sidebar-header input { + width: 100%; + padding: 15px; + border-radius: 15px; + border: none; + font-size: 15px; + color: white; + text-decoration: none; + background-color: #323446; +} + +#sidebar-header input:before { + content: "\f002"; + font-family: "Font Awesome 6 Free"; + font-weight: 900; + margin-right: 0.5em; +} + +#sidebar-content { + height: 100%; + overflow-y: auto; + padding-bottom: 50px; /* add padding to avoid content being hidden by the footer */ +} + +#sidebar-content ul { + list-style: none; + margin: 0; + padding: 10px; +} + +#sidebar-content ul li { + display: flex; + justify-content: flex-start; + align-items: center; + padding: 10px; + width: 100%; + cursor: pointer; + border-radius: 15px; + color: white; +} + +#sidebar-content ul li.active { + background-color: #5e5f71; +} + +#sidebar-content ul li button { + margin-left: auto; + background: transparent; + color: white; +} + +#sidebar-content ul li button:hover { + margin-left: auto; + border-radius: 5px; + background: #323446; +} + +#sidebar-content button { + padding: 10px; + border-radius: 15px; + border: none; + font-size: 14px; + background-color: transparent; + cursor: pointer; +} + +#new-tab-button { + display: block; + margin: 0 auto; + margin-top: 10px; + width: 93%; + padding: 5px; + border-radius: 15px; + border: none; + font-size: 14px; + color: #aac2d3; + background-color: transparent; + cursor: pointer; +} + +#new-tab-button:hover { + background-color: #5e5f71; + color: white; + cursor: pointer; +} \ No newline at end of file diff --git a/archive/1.2.6/logo.png b/archive/1.2.6/logo.png new file mode 100644 index 0000000..352f57d Binary files /dev/null and b/archive/1.2.6/logo.png differ diff --git a/archive/1.2.6/screenshot.png b/archive/1.2.6/screenshot.png new file mode 100644 index 0000000..649f1c4 Binary files /dev/null and b/archive/1.2.6/screenshot.png differ diff --git a/archive/1.2.6/theme/userChrome.css b/archive/1.2.6/theme/userChrome.css new file mode 100644 index 0000000..2238658 --- /dev/null +++ b/archive/1.2.6/theme/userChrome.css @@ -0,0 +1,51 @@ +#TabsToolbar, +#navigator-toolbox, +#toolbar-menubar { + visibility: collapse !important; +} + +#titlebar { + -moz-appearance: none !important; + height: 20px !important; + margin-top: -5px !important; + margin-left: -5px !important; + margin-right: -5px !important; + background-color: transparent !important; + position: fixed !important; + width: calc(100% + 10px) !important; + z-index: 9999 !important; + -webkit-app-region: drag !important; +} + +#browser { + border: 7px solid #3b3f52 !important; + browser-radius: 15px; + box-sizing: border-box; + background: #3b3f52; +} + +#appcontent { + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + overflow: hidden; +} + +/* Hide the sidebar title */ +#sidebar-header { + display: none; +} + +/* Fix the sidebar size */ +#sidebar-box { + min-width: 250px !important; + max-width: 300px !important; + min-height: unset !important; + max-height: unset !important; + border-right: none !important; +} + +#sidebar-splitter { + background-color: transparent !important; + border: none !important; + box-shadow: none !important; +} \ No newline at end of file diff --git a/core/manifest.json b/core/manifest.json index 7d81f06..2040b4e 100644 --- a/core/manifest.json +++ b/core/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "ArcFox", - "version": "1.2.6", + "version": "1.3.4", "description": "Make firefox flow like arc.", "icons": { "16": "icon.png", diff --git a/core/src/sidebar.js b/core/src/sidebar.js index a3f8473..3f11098 100644 --- a/core/src/sidebar.js +++ b/core/src/sidebar.js @@ -174,27 +174,39 @@ function searchBar() { // Render the tabs on sidebar function renderTabs(tabsToRender) { - tabList.innerHTML = ""; - for (let i = 0; i < tabsToRender.length; i++) { - const tab = tabsToRender[i]; - const tabItem = document.createElement("li"); - tabItem.textContent = tab.title; - tabItem.classList.add("tab-item"); - if (tab === activeTab) { - tabItem.classList.add("active"); - } - const closeButton = document.createElement("button"); - closeButton.innerHTML = "x"; - closeButton.addEventListener("click", function(event) { - event.stopPropagation(); - closeTab(tab); - }); - tabItem.appendChild(closeButton); - tabItem.addEventListener("click", function() { - activateTab(tab); + // Get the current tabs in the window + browser.tabs.query({ currentWindow: true }) + .then((tabs) => { + // Build a map of tab ID -> tab title for fast lookup + const tabTitleMap = {}; + for (const tab of tabs) { + tabTitleMap[tab.id] = tab.title; + } + + // Render the sidebar tabs + tabList.innerHTML = ""; + for (let i = 0; i < tabsToRender.length; i++) { + const tab = tabsToRender[i]; + const tabItem = document.createElement("li"); + tabItem.textContent = tabTitleMap[tab.id]; + tabItem.classList.add("tab-item"); + if (tab === activeTab) { + tabItem.classList.add("active"); + } + const closeButton = document.createElement("button"); + closeButton.textContent = "x"; + closeButton.classList.add("close-tab-button"); + closeButton.addEventListener("click", function(event) { + event.stopPropagation(); + closeTab(tab); + }); + tabItem.appendChild(closeButton); + tabItem.addEventListener("click", function() { + activateTab(tab); + }); + tabList.appendChild(tabItem); + } }); - tabList.appendChild(tabItem); - } } function activateTab(tab) { @@ -231,4 +243,4 @@ browser.tabs.onActivated.addListener(function(activeInfo) { return tab.id === activeInfo.tabId; }); renderTabs(tabs); -}); +}); \ No newline at end of file