diff --git a/src/inject.js b/src/inject.js index 33f239e..90ca0ea 100644 --- a/src/inject.js +++ b/src/inject.js @@ -575,10 +575,13 @@ function showModal(settings) { function addFediElements() { if (!$(".fediactrunning").length) { if ($("div.ui__header").is(":visible")) { - $("div.ui__header__links").prepend("FediAct running ") + $("div.ui__header__links").prepend("FediAct running") + $("div.ui__header__links").append("Go home") } else if ($("nav.header").length) { - $("nav.header div.nav-right").prepend("FediAct running ") + $("nav.header div.nav-right").prepend("FediAct running") + $("nav.header div.nav-right").append("Go home") } else if ($("div.sign-in-banner").length) { + $("div.sign-in-banner").append("Go home") $("div.sign-in-banner").append("FediAct running
") } } @@ -1414,6 +1417,7 @@ async function backgroundProcessor() { tmpSettings.processedFollow = [] tmpSettings.isProcessing = [] $(".fediactrunning").remove() + $(".fediactgohome").remove() // rerun getSettings to keep mutes/blocks up to date while not reloading the page if (!await getSettings()) { // but reload if settings are invalid diff --git a/src/inject.min.js b/src/inject.min.js index 75bc3c1..c54c1dd 100644 --- a/src/inject.min.js +++ b/src/inject.min.js @@ -1 +1 @@ -const i=["div.account__header button.logo-button","div.public-account-header a.logo-button","div.account-card a.logo-button","div.directory-card a.icon-button","div.detailed-status a.logo-button","button.remote-button","div.account__header button.button--follow"],u=["div.account__header__tabs__name small","div.public-account-header__tabs__name small","div.detailed-status span.display-name__account","div.display-name > span","a.user-screen-name","div.profile-info-panel small"],n=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/,S=/^(?"),r)&&(M.processed[r][10]=!0,M.processed[r][11]=!0),t}}async function m(t,e){if(!q.fediact_autoaction)return z("Auto-action disabled."),!0;n=e,i=!1,$(n.currentTarget).children("i.fa-retweet").length?i=$(n.currentTarget).children("i.fa-retweet").hasClass("fediactive")?"unboost":"boost":$(n.currentTarget).children("i.fa-star").length?i=$(n.currentTarget).hasClass("fediactive")?"unfavourite":"favourite":$(n.currentTarget).children("i.fa-bookmark").length?i=$(n.currentTarget).hasClass("fediactive")?"unbookmark":"bookmark":$(n.currentTarget).attr("href")&&(~$(n.currentTarget).attr("href").indexOf("type=reblog")?i=$(n.currentTarget).hasClass("fediactive")?"unboost":"boost":~$(n.currentTarget).attr("href").indexOf("type=favourite")&&(i=$(n.currentTarget).hasClass("fediactive")?"unfavourite":"favourite"));var i,n=i;if(n){if(await U(t,n,null))return r&&(M.processed[r][11]=!0),"boost"==n||"unboost"==n?(B($(e.currentTarget),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),B($(e.currentTarget).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive"),r&&(M.processed[r][3]=!M.processed[r][3])):"favourite"==n||"unfavourite"==n?(B($(e.currentTarget),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),B($(e.currentTarget).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive"),r&&(M.processed[r][4]=!M.processed[r][4])):(B($(e.currentTarget),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),r&&(M.processed[r][5]=!M.processed[r][5])),!0;z("Could not execute action on home instance.")}else z("Could not determine action.")}function g(t){$(e).find(".fediactunresolved").remove(),$(e).find(".fediactprocessing").remove(),t[1]?($(l).removeClass("disabled").removeAttr("disabled"),$(p).removeClass("disabled").removeAttr("disabled"),$(f).removeAttr("disabled"),t[4]&&!$(c).hasClass("fediactive")&&(B($(c),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),B($(c).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive")),t[3]&&!$(d).find("i.fediactive").length&&(B($(d),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),B($(d).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive")),t[5]&&!$(l).hasClass("fediactive")&&B($(l),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),t[10]&&($(f).hide(),$(f).closest("div.poll").find("ul").replaceWith("
View the results on your home instance.
"))):$("Unresolved").insertAfter($(c))}function v(a){var t=a[1].split("@"),e=t.pop()||t.pop();$(u).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&F(a[7]+"?fedireply")}),$(p).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],j(a[1])?t.push(["unblock",a[6]]):t.push(["block",a[6]]),J(a[1])?t.push(["unmute",a[6]]):t.push(["mute",a[6]]),W(a[1])?t.push(["domainunblock",e]):t.push(["domainblock",e]),H(t))}),$([c,d,l,f]).each(function(){$(f).length&&$(f).get(0).isEqualNode($(this).get(0))&&(e=!0);var e,i,n=0;$(this).on("click",async function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++n?i=setTimeout(async function(){(e&&!a[10]?h(a[9],a[7],t):await m(a[2],t))||z("Action failed."),n=0},350):(clearTimeout(i),(e?h(a[9],a[7],t):await m(a[2],t))?F(a[7]):z("Action failed."),n=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})})}if(r){var b=M.processed[r];g(b),b[1]&&v(b)}else{if(n&&s.push(a),t){var _,k,w,y=t.match(S),[T,A]=[!1,!1],x=(!y.groups.handledomain||~location.hostname.indexOf(y.groups.handledomain)||(T=!0),[i]);n||x.push(a);for(_ of x=x.filter((t,e)=>void 0!==t&&x.indexOf(t)==e))T?A||((k=await X(location.protocol+"//"+location.hostname+"/"+t+"/"+_))&&(A=!0,s.push(k),I.test(k)?(w=k.match(I)).groups.handle&&w.groups.tootid&&w.groups.domain&&s.push(w.groups.domain+"/@"+w.groups.handle+"/"+w.groups.tootid):S.test(k)&&(w=k.match(S)).groups.handle&&w.groups.tootid&&w.groups.domain&&s.push(w.groups.domain+"/users/"+w.groups.handle+"/statuses/"+w.groups.tootid)),s.push(location.protocol+"//"+location.hostname+"/"+t+"/"+_)):(s.push(location.protocol+"//"+location.hostname+"/users/"+y.groups.handle+"/statuses/"+_),s.push(location.protocol+"//"+location.hostname+"/@"+y.groups.handle+"/"+_))}if(s.length){var C,P,O,N,R,D=!1;for(C of s=s.filter((t,e)=>s.indexOf(t)==e))D||([P,O]=await V(C),P&&(D=!0,N="https://"+q.fediact_homeinstance+"/@"+P[0]+"/"+P[1],R=[o,...P,N,!0,...O,!1]));D?(r=G(R),g(R),v(R)):(z("Failed to resolve: "+s),r=G([o,!1]),g([o,!1]))}else z("Could not identify a post URI for home resolving."),r=G([o,!1]),g([o,!1])}}else z("Could not get toot data.")}}$(document).DOMNodeAppear(async function(t){M.isProcessing.includes($(t.target).get(0))||(M.isProcessing.push($(t.target).get(0)),e($(t.target)))},"div.status, div.detailed-status"),$(document).find("div.status, div.detailed-status").each(function(){M.isProcessing.includes($(this).get(0))||(M.isProcessing.push($(this).get(0)),e($(this)))})}async function D(){async function e(n){Q();var e,a,t,i,o,s,r="follow",c=$(n).siblings("button:has(i.fa-ellipsis-fw,i.fa-ellipsis-v,i.fa-ellipsis-h)");async function d(t){return q.fediact_autoaction?(t=await U(t,r,null),"follow"==r&&t?($(n).text("Unfollow"),r="unfollow",!0):"unfollow"==r&&t?($(n).text("Follow"),r="follow",!0):void 0):(z("Auto-action disabled."),!0)}if($(n).closest("div.account-card").length)e=$(n).closest("div.account-card").find("div.display-name > span").text().trim();else for(const l of u)if($(l).length){(e=$(l).text().trim()).split("@").length-1==1&&(e=e+"@"+M.exturi);break}e&&!M.processedFollow.includes(e)&&($("Resolving... ").insertBefore($(n)),(a=await O(e))?(M.processedFollow.push(e),$(c).length&&$(c).removeClass("disabled").removeAttr("disabled"),t=e.split("@"),i=t.pop()||t.pop(),(await P([a[0]]))[0]&&($(n).text("Unfollow"),r="unfollow"),$(c).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],j(e)?t.push(["unblock",a[0]]):t.push(["block",a[0]]),J(e)?t.push(["unmute",a[0]]):t.push(["mute",a[0]]),W(e)?t.push(["domainunblock",i]):t.push(["domainblock",i]),H(t))}),o=0,$(n).on("click",async function(t){var e,i;t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++o?s=setTimeout(async function(){d(a[0]),o=0},350):(clearTimeout(s),await d(a[0])?(e=$(n).text(),i="https://"+q.fediact_homeinstance+"/@"+a[1],$(n).text("Redirecting..."),setTimeout(function(){F(i),$(n).text(e)},1e3)):z("Action failed."),o=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})):z("Could not resolve user home ID."),$(n).siblings(".fediactprocessing").remove())}var t=i.join(",");$(document).DOMNodeAppear(async function(t){M.isProcessing.includes($(t.target).get(0))||(M.isProcessing.push($(t.target).get(0)),e($(t.target)))},t),$(document).find(t).each(function(){M.isProcessing.includes($(this).get(0))||(M.isProcessing.push($(this).get(0)),e($(this)))})}function t(t){var e,i=[];for(e of t.split(/\r?\n/))(e=e.trim()).length&&(n.test(e)?i.push(e):z("Removed invalid domain "+e+" from blacklist/whitelist."));return[...new Set(i)]}function E(){if(null==q.fediact_homeinstance||!q.fediact_homeinstance)return z("Mastodon home instance is not set."),!1;if(!q.fediact_token)return z("No API token available. Are you logged in to your home instance? If yes, wait for 1-2 minutes and reload page."),!1;if(M.tokenheader={Authorization:"Bearer "+q.fediact_token},!n.test(q.fediact_homeinstance))return z("Instance setting is not a valid domain name."),!1;if("whitelist"==q.fediact_mode){if(M.whitelist=t(q.fediact_whitelist),M.whitelist.length<1)return z("Whitelist is empty or invalid."),!1}else M.blacklist=t(q.fediact_blacklist);return!0}async function Y(){if(location.hostname==q.fediact_homeinstance&&(M.fedireply=A("fedireply"),!M.fedireply))return z("Current site is your home instance."),!1;if("whitelist"==q.fediact_mode){if($.inArray(location.hostname,M.whitelist)<0)return z("Current site is not in whitelist."),!1}else if(-1<$.inArray(location.hostname,M.blacklist))return z("Current site is in blacklist."),!1;var t=await m("GET",location.protocol+"//"+location.hostname+o,null,null);return!!t&&!(!(t=JSON.parse(t).uri)||(t.startsWith("http")?(t=new URL(t),M.exturi=t.hostname):M.exturi=t,Z()?!q.fediact_runifloggedin&&!M.fedireply&&await T()&&(z("Already logged in to this external instance."),1):(z("Could not start background process"),1)))}async function Z(){chrome.runtime.onMessage.addListener(async function(t,e,i){t.urlchanged&&(M.processed=[],M.processedFollow=[],M.isProcessing=[],$(".fediactrunning").remove(),await b()||location.reload()),t.updatedfedisettings&&location.reload()});try{return await chrome.runtime.sendMessage({running:!0}),!0}catch(t){z(t)}return!1}function b(){return new Promise(async function(e){try{q=await(browser||chrome).storage.local.get(y)}catch(t){z(t),e(!1)}q&&E()?e(!0):e(!1)})}async function tt(){await(browser||chrome).storage.local.set(q),await b()||location.reload()}async function et(){await b()?await Y()?(M.fedireply?N:(D(),R))():z("Will not process this site."):z("Could not load settings.")}et();
\ No newline at end of file
+const i=["div.account__header button.logo-button","div.public-account-header a.logo-button","div.account-card a.logo-button","div.directory-card a.icon-button","div.detailed-status a.logo-button","button.remote-button","div.account__header button.button--follow"],u=["div.account__header__tabs__name small","div.public-account-header__tabs__name small","div.detailed-status span.display-name__account","div.display-name > span","a.user-screen-name","div.profile-info-panel small"],a=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/,S=/^(?
"),r)&&(M.processed[r][10]=!0,M.processed[r][11]=!0),t}}async function m(t,e){if(!q.fediact_autoaction)return z("Auto-action disabled."),!0;a=e,i=!1,$(a.currentTarget).children("i.fa-retweet").length?i=$(a.currentTarget).children("i.fa-retweet").hasClass("fediactive")?"unboost":"boost":$(a.currentTarget).children("i.fa-star").length?i=$(a.currentTarget).hasClass("fediactive")?"unfavourite":"favourite":$(a.currentTarget).children("i.fa-bookmark").length?i=$(a.currentTarget).hasClass("fediactive")?"unbookmark":"bookmark":$(a.currentTarget).attr("href")&&(~$(a.currentTarget).attr("href").indexOf("type=reblog")?i=$(a.currentTarget).hasClass("fediactive")?"unboost":"boost":~$(a.currentTarget).attr("href").indexOf("type=favourite")&&(i=$(a.currentTarget).hasClass("fediactive")?"unfavourite":"favourite"));var i,a=i;if(a){if(await U(t,a,null))return r&&(M.processed[r][11]=!0),"boost"==a||"unboost"==a?(L($(e.currentTarget),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),L($(e.currentTarget).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive"),r&&(M.processed[r][3]=!M.processed[r][3])):"favourite"==a||"unfavourite"==a?(L($(e.currentTarget),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),L($(e.currentTarget).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive"),r&&(M.processed[r][4]=!M.processed[r][4])):(L($(e.currentTarget),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),r&&(M.processed[r][5]=!M.processed[r][5])),!0;z("Could not execute action on home instance.")}else z("Could not determine action.")}function g(t){$(e).find(".fediactunresolved").remove(),$(e).find(".fediactprocessing").remove(),t[1]?($(l).removeClass("disabled").removeAttr("disabled"),$(p).removeClass("disabled").removeAttr("disabled"),$(f).removeAttr("disabled"),t[4]&&!$(c).hasClass("fediactive")&&(L($(c),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),L($(c).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive")),t[3]&&!$(d).find("i.fediactive").length&&(L($(d),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),L($(d).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive")),t[5]&&!$(l).hasClass("fediactive")&&L($(l),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),t[10]&&($(f).hide(),$(f).closest("div.poll").find("ul").replaceWith("
View the results on your home instance.
"))):$("Unresolved").insertAfter($(c))}function v(n){var t=n[1].split("@"),e=t.pop()||t.pop();$(u).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&F(n[7]+"?fedireply")}),$(p).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],j(n[1])?t.push(["unblock",n[6]]):t.push(["block",n[6]]),J(n[1])?t.push(["unmute",n[6]]):t.push(["mute",n[6]]),W(n[1])?t.push(["domainunblock",e]):t.push(["domainblock",e]),H(t))}),$([c,d,l,f]).each(function(){$(f).length&&$(f).get(0).isEqualNode($(this).get(0))&&(e=!0);var e,i,a=0;$(this).on("click",async function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++a?i=setTimeout(async function(){(e&&!n[10]?h(n[9],n[7],t):await m(n[2],t))||z("Action failed."),a=0},350):(clearTimeout(i),(e?h(n[9],n[7],t):await m(n[2],t))?F(n[7]):z("Action failed."),a=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})})}if(r){var b=M.processed[r];g(b),b[1]&&v(b)}else{if(a&&s.push(n),t){var _,k,w,y=t.match(S),[T,A]=[!1,!1],x=(!y.groups.handledomain||~location.hostname.indexOf(y.groups.handledomain)||(T=!0),[i]);a||x.push(n);for(_ of x=x.filter((t,e)=>void 0!==t&&x.indexOf(t)==e))T?A||((k=await X(location.protocol+"//"+location.hostname+"/"+t+"/"+_))&&(A=!0,s.push(k),I.test(k)?(w=k.match(I)).groups.handle&&w.groups.tootid&&w.groups.domain&&s.push(w.groups.domain+"/@"+w.groups.handle+"/"+w.groups.tootid):S.test(k)&&(w=k.match(S)).groups.handle&&w.groups.tootid&&w.groups.domain&&s.push(w.groups.domain+"/users/"+w.groups.handle+"/statuses/"+w.groups.tootid)),s.push(location.protocol+"//"+location.hostname+"/"+t+"/"+_)):(s.push(location.protocol+"//"+location.hostname+"/users/"+y.groups.handle+"/statuses/"+_),s.push(location.protocol+"//"+location.hostname+"/@"+y.groups.handle+"/"+_))}if(s.length){var C,P,O,N,R,D=!1;for(C of s=s.filter((t,e)=>s.indexOf(t)==e))D||([P,O]=await V(C),P&&(D=!0,N="https://"+q.fediact_homeinstance+"/@"+P[0]+"/"+P[1],R=[o,...P,N,!0,...O,!1]));D?(r=B(R),g(R),v(R)):(z("Failed to resolve: "+s),r=B([o,!1]),g([o,!1]))}else z("Could not identify a post URI for home resolving."),r=B([o,!1]),g([o,!1])}}else z("Could not get toot data.")}}$(document).DOMNodeAppear(async function(t){M.isProcessing.includes($(t.target).get(0))||(M.isProcessing.push($(t.target).get(0)),e($(t.target)))},"div.status, div.detailed-status"),$(document).find("div.status, div.detailed-status").each(function(){M.isProcessing.includes($(this).get(0))||(M.isProcessing.push($(this).get(0)),e($(this)))})}async function D(){async function e(a){Q();var e,n,t,i,o,s,r="follow",c=$(a).siblings("button:has(i.fa-ellipsis-fw,i.fa-ellipsis-v,i.fa-ellipsis-h)");async function d(t){return q.fediact_autoaction?(t=await U(t,r,null),"follow"==r&&t?($(a).text("Unfollow"),r="unfollow",!0):"unfollow"==r&&t?($(a).text("Follow"),r="follow",!0):void 0):(z("Auto-action disabled."),!0)}if($(a).closest("div.account-card").length)e=$(a).closest("div.account-card").find("div.display-name > span").text().trim();else for(const l of u)if($(l).length){(e=$(l).text().trim()).split("@").length-1==1&&(e=e+"@"+M.exturi);break}e&&!M.processedFollow.includes(e)&&($("Resolving... ").insertBefore($(a)),(n=await O(e))?(M.processedFollow.push(e),$(c).length&&$(c).removeClass("disabled").removeAttr("disabled"),t=e.split("@"),i=t.pop()||t.pop(),(await P([n[0]]))[0]&&($(a).text("Unfollow"),r="unfollow"),$(c).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],j(e)?t.push(["unblock",n[0]]):t.push(["block",n[0]]),J(e)?t.push(["unmute",n[0]]):t.push(["mute",n[0]]),W(e)?t.push(["domainunblock",i]):t.push(["domainblock",i]),H(t))}),o=0,$(a).on("click",async function(t){var e,i;t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++o?s=setTimeout(async function(){d(n[0]),o=0},350):(clearTimeout(s),await d(n[0])?(e=$(a).text(),i="https://"+q.fediact_homeinstance+"/@"+n[1],$(a).text("Redirecting..."),setTimeout(function(){F(i),$(a).text(e)},1e3)):z("Action failed."),o=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})):z("Could not resolve user home ID."),$(a).siblings(".fediactprocessing").remove())}var t=i.join(",");$(document).DOMNodeAppear(async function(t){M.isProcessing.includes($(t.target).get(0))||(M.isProcessing.push($(t.target).get(0)),e($(t.target)))},t),$(document).find(t).each(function(){M.isProcessing.includes($(this).get(0))||(M.isProcessing.push($(this).get(0)),e($(this)))})}function t(t){var e,i=[];for(e of t.split(/\r?\n/))(e=e.trim()).length&&(a.test(e)?i.push(e):z("Removed invalid domain "+e+" from blacklist/whitelist."));return[...new Set(i)]}function E(){if(null==q.fediact_homeinstance||!q.fediact_homeinstance)return z("Mastodon home instance is not set."),!1;if(!q.fediact_token)return z("No API token available. Are you logged in to your home instance? If yes, wait for 1-2 minutes and reload page."),!1;if(M.tokenheader={Authorization:"Bearer "+q.fediact_token},!a.test(q.fediact_homeinstance))return z("Instance setting is not a valid domain name."),!1;if("whitelist"==q.fediact_mode){if(M.whitelist=t(q.fediact_whitelist),M.whitelist.length<1)return z("Whitelist is empty or invalid."),!1}else M.blacklist=t(q.fediact_blacklist);return!0}async function Y(){if(location.hostname==q.fediact_homeinstance&&(M.fedireply=A("fedireply"),!M.fedireply))return z("Current site is your home instance."),!1;if("whitelist"==q.fediact_mode){if($.inArray(location.hostname,M.whitelist)<0)return z("Current site is not in whitelist."),!1}else if(-1<$.inArray(location.hostname,M.blacklist))return z("Current site is in blacklist."),!1;var t=await m("GET",location.protocol+"//"+location.hostname+o,null,null);return!!t&&!(!(t=JSON.parse(t).uri)||(t.startsWith("http")?(t=new URL(t),M.exturi=t.hostname):M.exturi=t,Z()?!q.fediact_runifloggedin&&!M.fedireply&&await T()&&(z("Already logged in to this external instance."),1):(z("Could not start background process"),1)))}async function Z(){chrome.runtime.onMessage.addListener(async function(t,e,i){t.urlchanged&&(M.processed=[],M.processedFollow=[],M.isProcessing=[],$(".fediactrunning").remove(),$(".fediactgohome").remove(),await b()||location.reload()),t.updatedfedisettings&&location.reload()});try{return await chrome.runtime.sendMessage({running:!0}),!0}catch(t){z(t)}return!1}function b(){return new Promise(async function(e){try{q=await(browser||chrome).storage.local.get(y)}catch(t){z(t),e(!1)}q&&E()?e(!0):e(!1)})}async function tt(){await(browser||chrome).storage.local.set(q),await b()||location.reload()}async function et(){await b()?await Y()?(M.fedireply?N:(D(),R))():z("Will not process this site."):z("Could not load settings.")}et(); \ No newline at end of file diff --git a/src/styles.css b/src/styles.css index 99d9fe7..5ad538e 100644 --- a/src/styles.css +++ b/src/styles.css @@ -77,6 +77,10 @@ color: green; } +.fediactrunning.fediv3 { + padding-right: 10px; +} + /* We insert these styles for the DOMNodeAppeared function as separate stylesheet (see manifest) to fix diff --git a/src/styles.min.css b/src/styles.min.css index bd4c23f..af55aaa 100644 --- a/src/styles.min.css +++ b/src/styles.min.css @@ -1 +1 @@ -.fediactmodal{position:fixed;z-index:99999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,0.4);margin:0;padding:0}.fediactmodalinner{background-color:#494949;border:1px solid #888;width:50%;max-width:300px;left:50%;top:50%;transform:translate(-50%,-50%);position:absolute;margin:0;padding:0}.fediactmodallist{width:100%;margin:0;padding:0}.fediactmodalitem{cursor:pointer;width:100%;padding:5px 10px;box-sizing:border-box}.fediactmodallink{font-size:16px;cursor:pointer;text-decoration:none;color:white}.fediactprocessing{color:white;padding-right:10px;padding-left:10px}.fediactunresolved{color:orange;padding-right:10px;padding-left:10px}.fediactvoted{font-style:italic}.fediactvoted>a{font-weight:bold;color:orange}.fediactrunning{height:100%;display:flex;align-items:center;justify-content:center;color:green}@-moz-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-webkit-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-ms-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-o-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@keyframes nodeInserted{from{opacity:1}to{opacity:1}}div.status,div.detailed-status,div.detailed-status__action-bar,div.account__header button.logo-button,div.account__header button.button--follow,div.public-account-header a.logo-button,div.account-card a.logo-button,div.directory-card a.icon-button,div.detailed-status a.logo-button,button.remote-button,script#initial-state{-webkit-animation-name:nodeInserted !important;-webkit-animation-duration:.001s !important;-ms-animation-name:nodeInserted !important;-ms-animation-duration:.001s !important;-moz-animation-name:nodeInserted !important;-moz-animation-duration:.001s !important;-o-animation-name:nodeInserted !important;-o-animation-duration:.001s !important;animation-name:nodeInserted !important;animation-duration:.001s !important} +.fediactmodal{position:fixed;z-index:99999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,0.4);margin:0;padding:0}.fediactmodalinner{background-color:#494949;border:1px solid #888;width:50%;max-width:300px;left:50%;top:50%;transform:translate(-50%,-50%);position:absolute;margin:0;padding:0}.fediactmodallist{width:100%;margin:0;padding:0}.fediactmodalitem{cursor:pointer;width:100%;padding:5px 10px;box-sizing:border-box}.fediactmodallink{font-size:16px;cursor:pointer;text-decoration:none;color:white}.fediactprocessing{color:white;padding-right:10px;padding-left:10px}.fediactunresolved{color:orange;padding-right:10px;padding-left:10px}.fediactvoted{font-style:italic}.fediactvoted>a{font-weight:bold;color:orange}.fediactrunning{height:100%;display:flex;align-items:center;justify-content:center;color:green}.fediactrunning.fediv3{padding-right:10px}@-moz-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-webkit-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-ms-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@-o-keyframes nodeInserted{from{opacity:1}to{opacity:1}}@keyframes nodeInserted{from{opacity:1}to{opacity:1}}div.status,div.detailed-status,div.detailed-status__action-bar,div.account__header button.logo-button,div.account__header button.button--follow,div.public-account-header a.logo-button,div.account-card a.logo-button,div.directory-card a.icon-button,div.detailed-status a.logo-button,button.remote-button,script#initial-state{-webkit-animation-name:nodeInserted !important;-webkit-animation-duration:.001s !important;-ms-animation-name:nodeInserted !important;-ms-animation-duration:.001s !important;-moz-animation-name:nodeInserted !important;-moz-animation-duration:.001s !important;-o-animation-name:nodeInserted !important;-o-animation-duration:.001s !important;animation-name:nodeInserted !important;animation-duration:.001s !important}