commit 033c2e3c20f6ca690341e5e7cde2d4875bd934fa Author: thecookingsenpai Date: Fri Jan 26 22:31:27 2024 +0100 initial diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2574d37 --- /dev/null +++ b/LICENSE @@ -0,0 +1,6 @@ + CC BY-NC-SA 4.0 Deed +Attribution-NonCommercial-ShareAlike 4.0 International + +https://creativecommons.org/licenses/by-nc-sa/4.0/ + +Full text is available at: https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.en diff --git a/README.md b/README.md new file mode 100644 index 0000000..70a9164 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# Hop the Fence! + +An easy to use, fully customizable and privacy first web page simplifier! + +## What is HTF? + +HTF (Hop the Fence) is a simple extension that makes it easy to use services like 1ft.io, 12ft.io and self hosted services like Ladder and 13ft. + +## What HTF isn't + +HTF is NOT a way to bypass restrictions or paywalls or anything illegal. +Users should always ensure that they are allowed to access the services and the pages. + +## How to use HTF + +By default, HTF uses 12ft.io . You can click on the extension button and configure your own instance or your favorite provider in the options section. + +## Note + +HTF uses localStorage and the active tab url. Nothing is sent over to any server. \ No newline at end of file diff --git a/dist/HopTheFence1.0.xpi b/dist/HopTheFence1.0.xpi new file mode 100644 index 0000000..c9fc198 Binary files /dev/null and b/dist/HopTheFence1.0.xpi differ diff --git a/icons/LICENSE b/icons/LICENSE new file mode 100644 index 0000000..8c380e3 --- /dev/null +++ b/icons/LICENSE @@ -0,0 +1 @@ +These icons are taken from https://www.flaticon.com/free-icons/entrance by Rean-me \ No newline at end of file diff --git a/icons/dd.png b/icons/dd.png new file mode 100644 index 0000000..bc5b17c Binary files /dev/null and b/icons/dd.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..8ab67f6 --- /dev/null +++ b/manifest.json @@ -0,0 +1,19 @@ +{ + "manifest_version": 2, + "name": "HopTheFence", + "version": "1.0", + + "description": "Hop the fence! Access ladder services such as 12ft.io, 1ft.io and self hosted alternatives (Ladder & 13ft for example) with a button!", + + "icons": { + "512": "icons/dd.png" + }, + + "permissions": ["activeTab", "tabs"], + + "browser_action": { + "default_icon": "icons/dd.png", + "default_title": "Hop The Fence!", + "default_popup": "popup/ui.html" + } +} diff --git a/popup/assets/fence.jpeg b/popup/assets/fence.jpeg new file mode 100644 index 0000000..6f3f4f9 Binary files /dev/null and b/popup/assets/fence.jpeg differ diff --git a/popup/options.css b/popup/options.css new file mode 100644 index 0000000..64a6bf6 --- /dev/null +++ b/popup/options.css @@ -0,0 +1,112 @@ +/* Background data (Original source: https://subtlepatterns.com/grid-me/) */ +/* Animations */ +@-webkit-keyframes bg-scrolling-reverse { + 100% { + background-position: 50px 50px; + } + } + @-moz-keyframes bg-scrolling-reverse { + 100% { + background-position: 50px 50px; + } + } + @-o-keyframes bg-scrolling-reverse { + 100% { + background-position: 50px 50px; + } + } + @keyframes bg-scrolling-reverse { + 100% { + background-position: 50px 50px; + } + } + @-webkit-keyframes bg-scrolling { + 0% { + background-position: 50px 50px; + } + } + @-moz-keyframes bg-scrolling { + 0% { + background-position: 50px 50px; + } + } + @-o-keyframes bg-scrolling { + 0% { + background-position: 50px 50px; + } + } + @keyframes bg-scrolling { + 0% { + background-position: 50px 50px; + } + } + + + +body { + font-family: sans-serif; + font-size: 1.15em; + background-color: #fff; + color: #000; + + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAABnSURBVHja7M5RDYAwDEXRDgmvEocnlrQS2SwUFST9uEfBGWs9c97nbGtDcquqiKhOImLs/UpuzVzWEi1atGjRokWLFi1atGjRokWLFi1atGjRokWLFi1af7Ukz8xWp8z8AAAA//8DAJ4LoEAAlL1nAAAAAElFTkSuQmCC") repeat 0 0; + -webkit-animation: bg-scrolling-reverse 3s infinite; + /* Safari 4+ */ + -moz-animation: bg-scrolling-reverse 3s infinite; + /* Fx 5+ */ + -o-animation: bg-scrolling-reverse 3s infinite; + /* Opera 12+ */ + animation: bg-scrolling-reverse 3s infinite; + /* IE 10+ */ + -webkit-animation-timing-function: ease-in-out; + -moz-animation-timing-function: ease-in-out; + -o-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; +} + + +.card { + margin: 5px; + padding: 10px; + border: solid 1px #ccc; + border-radius: 25px; + width: fit-content; +} + +.centered { + justify-content: center; + align-items: center; + text-align: center; + font-size: 1.25em !important; +} + +.sameline { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} + +input { + margin: 5px; + padding: 5px; + border-radius: 5px; + border: solid 1px #ccc; + +} + +button { + border: solid 1px #ccc; + background-color: #fff; + color: #000; + font-size: 1.15em; + padding: 5px; + margin: 5px; + border-radius: 5px; + cursor: pointer; +} + +.label { + color: rgb(138, 8, 8); + font-style: italic; +} \ No newline at end of file diff --git a/popup/options.html b/popup/options.html new file mode 100644 index 0000000..4e25e32 --- /dev/null +++ b/popup/options.html @@ -0,0 +1,42 @@ + + + + + + + +

Hop the Fence!

+

Options

+
+


+

Please do not use this extension for illegal purpose. Is just a simplifier of many webpages.

+


+
+ + +
+
+ + + +

Actual Provider

+

Loading...

+
+
+ +
+

You can either keep the fallback provider or use your own instance of Ladder or 13ft. You can also use 12ft.io and 1ft directly.

+

The fallback provider is 12ft.io

+

12ft Home Page

+

The following services are supported (both self hosted or cloud hosted)

+

Ladder GitHub

+

13ft GitHub +

1ft Home Page

+

If you want to use your own instance, please set the provider in the input above.

+

In general, this extension works on every service that use the same syntax as the above ones.

+
+ + + + + \ No newline at end of file diff --git a/popup/options.js b/popup/options.js new file mode 100644 index 0000000..04839d1 --- /dev/null +++ b/popup/options.js @@ -0,0 +1,27 @@ +// GUI elements + +let actualProvider = document.getElementById('actual-provider'); + +let inputProvider = document.getElementById('provider'); +let inputProviderButton = document.getElementById('provider-button'); + +// Listeners +inputProviderButton.addEventListener('click', () => { + let provider = inputProvider.value; + if (provider) { + actualProvider.innerText = provider; + window.localStorage.setItem('ladderProvider', provider); + } +}); + +// Main function +async function ui() { + let provider = window.localStorage.getItem('ladderProvider'); + if (provider) { + actualProvider.innerText = provider; + } else { + actualProvider.innerText = 'Fallback (https://12ft.io/)'; + } +} + +ui() \ No newline at end of file diff --git a/popup/ui.css b/popup/ui.css new file mode 100644 index 0000000..29814fe --- /dev/null +++ b/popup/ui.css @@ -0,0 +1,37 @@ +body { + font-family: sans-serif; + font-size: 1.15em; + color: #000; + background-image: url("assets/fence.jpeg"); + background-size: cover; + background-repeat: no-repeat; + background-position: center; +} + +.popup { + background-color: #ffffff00; + border: solid 1px #cccccc5f; + border-radius: 25px; + width: fit-content; + padding: 10px; + margin: 5px; +} + +button { + border: solid 1px #ccc; + background-color: #ffffffb7; + color: #000; + font-size: 1.15em; + padding: 5px; + margin: 5px; + border-radius: 5px; + cursor: pointer; +} + + +.dim { + background-color: #ffffff9a; + width: fit-content; + padding: 10px; + margin: 5px; +} \ No newline at end of file diff --git a/popup/ui.html b/popup/ui.html new file mode 100644 index 0000000..aadc951 --- /dev/null +++ b/popup/ui.html @@ -0,0 +1,19 @@ + + + + + + + + + + +
+

This extension is made for legitimate use only.

+
+ + + diff --git a/popup/ui.js b/popup/ui.js new file mode 100644 index 0000000..a8c3701 --- /dev/null +++ b/popup/ui.js @@ -0,0 +1,65 @@ +// GUI Stuff +let configButton = document.getElementById('config-button'); +let ladderizeButton = document.getElementById('ladderize-button'); + +// Listeners + +configButton.addEventListener('click', function() { + chrome.tabs.create({url: "options.html"}); +}) + +ladderizeButton.addEventListener('click', function() { + ladderize() +}) + +// Main function +async function ui() { + let currentURL = window.location.href + console.log("Here we are: " + currentURL) +} + + +// Ladderize +async function ladderize() { + + const fallbackProvider = "https://12ft.io/" + var ladderProvider = null + + // Supporting user configurations + try { + ladderProvider = window.localStorage.getItem("ladderProvider") + } catch (error) { + ladderProvider = null + } + // Also managing the "" case so I dont have to test it manually + if (ladderProvider=="") { + ladderProvider = null + } + + console.log("Provisory provider: ") + console.log(ladderProvider) + + // Fallback management + if (!ladderProvider) { + ladderProvider = fallbackProvider + } + + console.log("Ladder provider: ") + console.log(ladderProvider) + + // Adding the "/" if not present + if ( !ladderProvider.endsWith("/") ) { + ladderProvider = ladderProvider + "/" + console.log("Fixed ladderProvider for you") + } + 'use strict'; + let allTabs = await browser.tabs.query({currentWindow: true, active: true}) + console.log(allTabs) + let currentTab = allTabs[0] + let currentURL = currentTab.url + + let ladderURL = ladderProvider + currentURL + window.open(ladderURL, '_blank'); +} + +ui() \ No newline at end of file diff --git a/web-ext-artifacts/hopthefence-1.0.zip b/web-ext-artifacts/hopthefence-1.0.zip new file mode 100644 index 0000000..a0b1b6a Binary files /dev/null and b/web-ext-artifacts/hopthefence-1.0.zip differ