Comments (9)
yes may be better. As we seem to be in agreement I will make a new build with this code using "data-message-box-creator".
from file-backups.
One solution would be to alway add a 'current saver attribute' and set to the name of the saver. Before any saving this attribute can be read, if it is not the same as set then don't do anything, except warn the user.
from file-backups.
May be it is enough to check if the messagebox exists when installing (if it already exists then another extension has created it).
from file-backups.
@pmario I have removed savetiddlers until this issue is resolved
from file-backups.
I just had a closer look to the following functions
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onInstalled
and
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/connect
But imo there is no "safe" way to communicate, that can't be abused by others. ... So imo the message box ID seems to be the easiest way.
from file-backups.
So the ContentScript can do the following:
// Inject the message box
var messageBox = doc.getElementById("tiddlyfox-message-box");
if (!messageBox) {
messageBox = doc.createElement("div");
messageBox.id = "tiddlyfox-message-box";
messageBox.setAttribute("data-tiddlyfox-creator", "<your-addon-name>")
messageBox.style.display = "none";
doc.body.appendChild(messageBox);
And if a new ContentScript is initialized, it can activate an info box.
If the user doesn't resolve the problem, a "tm-save-wiki" will cause a new message box. ... And so on.
from file-backups.
I was think of this:
// Inject the message box
var messageBox = doc.getElementById("tiddlyfox-message-box");
if(messageBox) {
var othersw = messageBox.getAttribute("data-message-box-creator")|| null;
if (othersw) {
alert ("as another tiddlysaver called "+othersw+" is install - savetiddlers is shutting down");
return;
} else {
messageBox.setAttribute("data-message-box-creator","savetiddlers");
} else {
messageBox = doc.createElement("div");
messageBox.id = "tiddlyfox-message-box";
messageBox.style.display = "none";
messageBox.setAttribute("data-message-box-creator","savetiddlers");
doc.body.appendChild(messageBox);
}
// Attach the event handler to the message box
messageBox.addEventListener("tiddlyfox-save-file",function(event) {
As we have return from the function no listener was installed so the extension does not react to requests
from file-backups.
alert ("as another tiddlysaver called "+othersw+" is install - savetiddlers is shutting down");
I think the newly imported plugin should be more "self-confident" :)
"savetiddlers" has detected another plugin named: "xxxx".\n
At the moment only 1 "convenience save mecahnism" can be active at once.\n
We will temporarily deactivate the functionality, until the problem is resolved!
This message pops up till the user solves the problem. ...
from file-backups.
But imo the main goal should be to make the convenience functions stackable.
from file-backups.
Related Issues (20)
- TW extension HOT 9
- Save file prompt on autosave in Firefox 59 HOT 2
- V0.3.7-beta - feedback
- file-backups fails to opt out of "Always ask you where to save files" HOT 7
- Support for Firefox Quantum Extended Support Release HOT 15
- Save Button does not work in Firefox 63 HOT 7
- Consistent "It's not possible to save changes." when I didn't change anything on my end HOT 26
- V0.3.10-beta - feedback HOT 1
- Barely working with FF69.0.2 HOT 5
- Fail to work with FF70 HOT 4
- Doesn't work if download path is less than two levels deep HOT 12
- Doesn't work on new Firefox (v71.0)! HOT 16
- V0.4.0 extension stops working HOT 33
- Better error handling for backpus directory setting HOT 1
- NoScript prevents editing tiddler content HOT 11
- Improve fb-installation process, if wiki tabs are alredy open
- Cancelling "Save As" keeps the blob memory occeupied.
- discussion: Extending the backup strategy HOT 1
- V0.4.0 feedback HOT 9
- Firefox changes the absolute path, which breaks file-backups HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from file-backups.