From a9a01491f0a8dd299728cdc2b9877321e23d5b8d Mon Sep 17 00:00:00 2001
From: NotAProton <notaproton8@gmail.com>
Date: Fri, 10 Sep 2021 14:04:04 +0530
Subject: [PATCH] Firefox nightly link and badge

---
 .firefox_build.php | 75 ----------------------------------------------
 README.md          | 36 +++++++++++++---------
 manifest.json      | 62 --------------------------------------
 3 files changed, 22 insertions(+), 151 deletions(-)
 delete mode 100644 .firefox_build.php
 delete mode 100644 manifest.json

diff --git a/.firefox_build.php b/.firefox_build.php
deleted file mode 100644
index e819ac1fa..000000000
--- a/.firefox_build.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-if(file_exists("Universal Bypass for Firefox.zip"))
-{
-	unlink("Universal Bypass for Firefox.zip");
-}
-
-echo "Indexing...\n";
-$index = [];
-function recursivelyIndex($dir)
-{
-	global $index;
-	foreach(scandir($dir) as $f)
-	{
-		if(substr($f, 0, 1) != ".")
-		{
-			$fn = $dir."/".$f;
-			if(is_dir($fn))
-			{
-				recursivelyIndex($fn);
-			}
-			else
-			{
-				array_push($index, substr($fn, 2));
-			}
-		}
-	}
-}
-recursivelyIndex(".");
-
-echo "Building...\n";
-function createZip($file)
-{
-	$zip = new ZipArchive();
-	$zip->open($file, ZipArchive::CREATE + ZipArchive::EXCL + ZipArchive::CHECKCONS) or die("Failed to create {$file}.\n");
-	return $zip;
-}
-$build = createZip("Universal Bypass for Firefox.zip");
-$build_id = intval(file_get_contents(".next_build_id.txt"));
-$json = json_decode(file_get_contents("manifest.json"), true);
-$extension_version = $json["version"];
-$definitions_version = substr(shell_exec("git rev-parse HEAD"), 0, 7);
-foreach($index as $fn)
-{
-	if($fn == "README.md" || $fn == "Universal Bypass for Chromium-based browsers.zip")
-	{
-		continue;
-	}
-	if($fn == "manifest.json")
-	{
-		$json = json_decode(file_get_contents($fn), true);
-		$json["version"] .= ".".$build_id;
-		$content = str_replace("    ", "\t", json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
-		$build->addFromString($fn, $content);
-	}
-	else if($fn == "background.js")
-	{
-		$content = str_replace([
-			"extension_version=brws.runtime.getManifest().version,",
-			"definitions_version=\"\",",
-			"if(definitions_version===\"\")",
-		],
-		[
-			"extension_version=\"{$extension_version}\",",
-			"definitions_version=\"{$definitions_version}\",",
-			"if(false)"
-		], file_get_contents($fn));
-		$build->addFromString($fn, $content);
-	}
-	else
-	{
-		$build->addFile($fn, $fn);
-	}
-}
-$build->close();
-file_put_contents(".next_build_id.txt", $build_id + 1);
diff --git a/README.md b/README.md
index 1676c4821..846eda846 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,17 @@
-<h1 align="center" font-size= "10em";>
-  Universal Bypass
-  <br>
+#  Universal Bypass
   <a href="https://github.com/Universal-Bypass-Renewed/Universal-Bypass/blob/main/.github/workflows/main.yml">
-  <img src="https://github.com/Universal-Bypass-Renewed/Universal-Bypass/actions/workflows/main.yml/badge.svg?branch=main">
+  <img src="https://badgen.net/github/checks/universal-bypass-renewed/universal-bypass?label=Build" />
   </a>
   <a href="https://discord.gg/RSAf7b5njt">
   <img src="https://badgen.net/badge/icon/discord?icon=discord&label=Universal+Bypass+Renewed" />
   </a>
-</h1>
+  <a href="https://nightly.link/Universal-Bypass-Renewed/Universal-Bypass/workflows/main/main/Universal_bypass_chromium.zip">
+  <img src="https://img.shields.io/badge/Chromium-Unstable-e77334" />
+  </a>
+  <a href="https://nightly.link/Universal-Bypass-Renewed/Universal-Bypass/workflows/main/main/Universal_bypass_firefox.zip">
+  <img src="https://img.shields.io/badge/Firefox-Unstable-e77334" />
+  </a>
+ 
 
 #### Don't waste your time with compliance. Universal Bypass automatically skips annoying link shorteners.
 
@@ -15,14 +19,13 @@ As you may know, universal bypass is no longer maintained by its original develo
 Thanks Sainan for your hard work.
 
 # Installing
-| Jump to section                           |
-| :-------------                            |
-| [Chromium based browsers](#id-chrome)     |
-| [Firefox](#id-firefox)                    |
+| Jump to section                                     |
+| :-------------                                      |
+| [Chromium based browsers](#chromium-based-browsers) |
+| [Firefox](#firefox)                                 |
 
-<div id='id-chrome' style="line-height: 2.5;"></div>
 
-### Chromium based browsers</h1>
+### Chromium based browsers
 
 Chromium based browsers include Chrome, Edge and Brave 
 
@@ -30,9 +33,14 @@ Chromium based browsers include Chrome, Edge and Brave
 3) Unnzip the file once
 4) Open the manage extensions page on your borwser and turn on "Developer Mode"
 5) Drag and drop "UniversalBypass_chromium_0.zip" into the manage extensions page
-If you need any help join our Discord: https://discord.gg/RSAf7b5njt
 
-<div id='id-firefox'> </div>
+If you need any help, join our Discord: https://discord.gg/RSAf7b5njt
 
 ### Firefox
-Sorry, we don't have firefox packages ready yet😓
+The addon will soon be in the mozilla store. If you want to try it *now* then-
+1) Download the zip file using [this link](https://nightly.link/Universal-Bypass-Renewed/Universal-Bypass/workflows/main/main/Universal_bypass_firefox.zip).
+2) Unnzip the file once
+3) Go to the manage addons page and click on the cog wheel
+4) Click on debug addons and then select "UniversalBypass_firefox_0.0.zip" after clickig on load temporary addon
+
+If you need any help, join our Discord: https://discord.gg/RSAf7b5njt
diff --git a/manifest.json b/manifest.json
deleted file mode 100644
index eb288775c..000000000
--- a/manifest.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
-  "manifest_version": 2,
-  "icons": {
-    "48": "icon/48.png",
-    "128": "icon/128.png",
-    "150": "icon/150.png",
-    "176": "icon/176.png",
-    "512": "icon/512.png"
-  },
-  "default_locale": "en",
-  "name": "Universal Bypass",
-  "description": "__MSG_appDesc__",
-  "homepage_url": "https://universal-bypass.org/",
-  "version": "13.5.2",
-  "author": "Sainan",
-  "permissions": [
-    "alarms",
-    "storage",
-    "webRequest",
-    "webRequestBlocking",
-    "<all_urls>"
-  ],
-  "options_ui": {
-    "page": "html/options.html",
-    "open_in_tab": true
-  },
-  "browser_action": {
-    "default_icon": {
-      "48": "icon/48.png",
-      "128": "icon/128.png",
-      "150": "icon/150.png",
-      "176": "icon/176.png",
-      "512": "icon/512.png"
-    },
-    "default_popup": "html/popup.html"
-  },
-  "background": {
-    "scripts": [
-      "background.js"
-    ]
-  },
-  "content_scripts": [
-    {
-      "matches": [
-        "<all_urls>"
-      ],
-      "js": [
-        "content_script.js"
-      ],
-      "run_at": "document_start"
-    }
-  ],
-  "web_accessible_resources": [
-    "html/before-navigate.html",
-    "html/blocked.html",
-    "html/crowd-bypassed.html",
-    "html/firstrun.html",
-    "html/firstrun-noscript.html",
-    "html/options.html",
-    "icon/48.png"
-  ]
-}
