Skip to content

Commit

Permalink
fix toot buttons in feed views when returning from redirect in "_self…
Browse files Browse the repository at this point in the history
…" mode, bump version
  • Loading branch information
lartsch committed Dec 29, 2022
1 parent f23e7be commit 0e20ff2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FediAct",
"version": "0.9.8.6",
"version": "0.9.8.7",
"description": "Simplifies interactions on other Mastodon instances than your own. Visit https://github.com/lartsch/FediAct for more.",
"manifest_version": 2,
"content_scripts": [
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FediAct",
"version": "0.9.8.6",
"version": "0.9.8.7",
"description": "Simplifies interactions on other Mastodon instances than your own. Visit https://github.com/lartsch/FediAct for more.",
"manifest_version": 3,
"content_scripts": [
Expand Down
13 changes: 13 additions & 0 deletions src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ function replaceAll(str, find, replace) {
function redirectTo(url) {
// check if redirects are enabled at all
if (settings.fediact_redirects) {
if (settings.fediact_target == "_self") {
/* If browser back button was used, flush cache */
(function () {
window.onpageshow = function(event) {
if (event.persisted) {
window.location.reload();
}
};
})()
}
// check if alert before redirect is enabled and show the prompt if so
if (settings.fediact_alert) {
if (!confirm("Redirecting to " + url)) {
Expand Down Expand Up @@ -878,6 +888,9 @@ async function processToots() {
var actionExecuted = await executeAction(id, action, null)
if (actionExecuted) {
if (cacheIndex) {
console.log(cacheIndex)
console.log(tmpSettings.processed[cacheIndex])
console.log(tmpSettings.processed)
// set interacted to true
tmpSettings.processed[cacheIndex][11] = true
}
Expand Down
Loading

0 comments on commit 0e20ff2

Please sign in to comment.