diff --git a/electron.html b/electron.html
index 0641e56..a4d5b64 100644
--- a/electron.html
+++ b/electron.html
@@ -1,28 +1,13 @@
-
-
-
+
+
-
✨ Great News! OBS v26.1.2
now supports OBS.Ninja without needing the Electron Capture app! 🥳
+
✨ Great News! OBS v26.1.2
now supports OBS.Ninja without needing the Electron Capture app! 🥳
+
✨ Great News!
Electron Capture is now available!
Update yours today to stay up-to-date with security patches.
-
✨ Great News! Electron Capture is now available!
Update yours today to stay up-to-date with security patches.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -182,26 +262,33 @@ input[type='checkbox']:checked {
* tree. Alternative licencing options can be made available on request.
*
*/
+var lastUrls = JSON.parse(localStorage.getItem('lastUrls'));
+if (lastUrls != undefined) {
+ document.querySelector("#changeText").value = lastUrls[0];
+ if (lastUrls.length>0){
+ lastUrls.forEach((url)=>{
+ var o = document.createElement('option');
+ o.value = url;
+ o.text = url;
+ document.querySelector("#lastUrls").appendChild(o);
+ })
+ } else {
+ document.querySelector("#history").style.display="none";
+ }
+} else {
+ document.querySelector("#history").style.display="none";
+}
+function setUrl(){
+ document.querySelector("#changeText").value = document.querySelector("#lastUrls").value;
+ gohere();
+}
-(function (w) {
- w.URLSearchParams = w.URLSearchParams || function (searchString) {
- var self = this;
- self.searchString = searchString;
- self.get = function (name) {
- var results = new RegExp('[\?&]' + name + '=([^]*)').exec(self.searchString);
- if (results == null) {
- return null;
- }
- else {
- return decodeURI(results[1]) || 0;
- }
- };
- }
-
-})(window)
-
-var urlParams = new URLSearchParams(window.location.search);
+function resetHistory(){
+ localStorage.clear();
+ document.querySelector('#lastUrls').innerHTML = '';
+ lastUrls = [];
+}
if (navigator.userAgent.indexOf('Mac OS X') != -1){
document.getElementById("warning4mac").style.display="block";
@@ -231,7 +318,7 @@ if (navigator.userAgent.indexOf('Mac OS X') != -1){
document.getElementById("electronVersion").style.display = "block";
document.getElementById("currentElectronVersion").innerText = data.tag_name;
}
- });
+ }).catch(console.error);
}
if (urlParams.has('version')){
var ver = urlParams.get('version');
@@ -313,15 +400,32 @@ function enterPressed(event, callback){
}
}
+(function (w) {
+ w.URLSearchParams = w.URLSearchParams || function (searchString) {
+ var self = this;
+ self.searchString = searchString;
+ self.get = function (name) {
+ var results = new RegExp('[\?&]' + name + '=([^]*)').exec(self.searchString);
+ if (results == null) {
+ return null;
+ }
+ else {
+ return decodeURI(results[1]) || 0;
+ }
+ };
+ }
+})(window)
+
+var urlParams = new URLSearchParams(window.location.search);
var isMobile = false;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ // does not detect iPad Pros.
isMobile=true; // if iOS, default to H264? meh. let's not.
}
// Windows can show the cursor, since it captures in a different way.
-if (navigator.platform.indexOf("Win") != -1){
- document.getElementById("showcursor").checked=true;
-}
+//if (navigator.platform.indexOf("Win") != -1){
+// document.getElementById("showcursor").checked=true;
+//}
function updateURLParameter(url, param, paramVal){
var TheAnchor = null;
@@ -374,60 +478,28 @@ if (urlParams.has('name')){
}
}
+function addUrlToHistory(url){
+ if (lastUrls == undefined){
+ lastUrls = [];
+ }
+ if ( lastUrls[0] != url ) {
+ lastUrls.unshift(url);
+ if (lastUrls.length == 6) {
+ lastUrls.pop();
+ }
+ }
+}
+
function modURL(ele=false){
var url = document.getElementById('changeText').value;
console.log(url);
- if ((url.split("view").length>0) || (url.split("room").length>0)){
- if (!document.getElementById("showcursor").checked){
- url=updateURLParameter(url, "nocursor", "");
- } else {
- url=updateURLParameter(url, "nocursor", false);
- }
-
- if (ele!=false){
- if (ele.id =="prefervp9"){
- if (document.getElementById("prefervp9").checked){
- url=updateURLParameter(url, "codec", "vp9");
- } else {
- url=updateURLParameter(url, "codec", false);
- }
- }
-
- if (ele.id =="highbitrate"){
- if (document.getElementById("highbitrate").checked){
- url=updateURLParameter(url, "bitrate", "10000");
- } else {
- url=updateURLParameter(url, "bitrate", false);
- }
- }
-
- if (ele.id =="stereo"){
- if (document.getElementById("stereo").checked){
- url=updateURLParameter(url, "proaudio", "");
- document.getElementById("messageDiv").innerHTML = "Audio bitrate increased to 256-kbps.\n\nPlease note that the Sender must also have the
&proaudio flag added for full-effect";
- document.getElementById("messageDiv").style.display="block";
- setTimeout(function(){document.getElementById("messageDiv").style.opacity="1.0";},0);
- } else {
- url=updateURLParameter(url, "proaudio", false);
- setTimeout(function(){document.getElementById("messageDiv").style.opacity="0";},0);
- }
- }
-
- if (ele.id =="buffer"){
- if (document.getElementById("buffer").checked){
- url=updateURLParameter(url, "buffer", "");
- } else {
- url=updateURLParameter(url, "buffer", false);
- }
- }
- }
-
- }
document.getElementById('changeText').value = url;
console.log(url);
return url;
}
function gohere(){
+ addUrlToHistory(document.getElementById('changeText').value);
+ localStorage.setItem('lastUrls', JSON.stringify(lastUrls));
var url = modURL(true);
if (!(document.getElementById('changeText').value.includes("obs.ninja")) && (document.getElementById('changeText').value.includes("http")) && (document.getElementById('changeText').value.includes("&sink"))){
alert("Notice: The &sink command is domain specific.\nVisit https://YOURDOMAIN.com/electron instead.");
@@ -437,27 +509,4 @@ function gohere(){
getPermssions();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+