New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GM_notification API #1194
Comments
using the patch from #1193 this is a piece of cake, the clickable part is a little extra work tho. |
Would be nice to have it outside of the unprivileged DOM sometimes... but consensus on what kind of notification may be an issue. |
The phrase "send notifications" is extremely vague. Assuming that you intend this to mean "provide an interface to nsIAlertsService" I'd have to think a while before I could form a clear opinion. In general, I really dislike the toast notifications that (I assume) this provides. They appear to be extremely brief and difficult to interact with. Almost every time (e.g.) either Firefox or Thunderbird tells me there's an update or a new message, the toast has disappeared almost before I've had time to stop what I'm doing, read the box, and figure out what it says. I think my gut reaction would be that this should be an @require that puts it in the DOM of that page, otherwise how is the user supposed to know which page the message is coming from (especially when there could be multiple appropriate tabs open)? |
Yes this is would use what I implemented in #1193
Well I love them, and I think it's better for a user script author to decide if it's useful to their script or not. Besides I think how long they appear is a customizable setting, at least w/ osx I know it is.
how would that be done..?
the title can be the name of the user script, and the icon could be it's @ICON. |
alerts.totalOpenTime is the setting that you want to change, the default value is 4secs, I usually like 30secs. |
Would you be willing to add custom image support? function GM_notification(aMsg, aTitle, aImg) { var title = aTitle ? "" + aTitle : "Greasemonkey"; var message = aMsg ? "" + aMsg : ""; var image = aImg ? "" + aImg : "chrome://greasemonkey/skin/icon_medium.png"; try { alertsServ.showAlertNotification( image, title, message, false, "", null); //This looks better on ubuntu than windows ( http://i55.tinypic.com/2jfwtg9.png ) } catch (e) { // In case e.g. Growl is not installed on a Mac. alert(title + "\n" + message); } }; |
Duped by #1271 |
voting wontfix on this |
Why? arantius wrote: This feature would be helpful for scripts that redirect the DOM multiple times and eventually land on an image instead of a htm/l and still allow notifications to the end user that a certain detail has occurred. As we all know user.js only works on .htm/l files not images. Voting +1 to expose the API function to the EDIT: To address the request from GM-Script-Writer-62850 the value at |
Firefox 22 has web notifications support: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/22 |
+1 |
But I think it has a major mistake (https://bugzilla.mozilla.org/show_bug.cgi?id=875114, respectively https://bugzilla.mozilla.org/show_bug.cgi?id=862395). Then I can close: #1742 |
In some use cases we might be able to use web notifications instead, which can be added to Firefox using various addons like tab notifier. |
But by using web notification api, script can only pop up notifications if user allow the site to do so. User have no choice to disable notifications from the website but enable it from script. |
Right, I totally missed that aspect. 👍 |
Again, this API is needed since the website begin to show notifications which user want to block them. But I need to show notifications too. As the result, user have no chose between disable all these notifications or enable all of them. I need this API so that user may only allow notifications from the userscript. |
The testing branch: Synchronize API with Tampermonkey This is just a thing for testing!
|
@janekptacijarabaci Thanks, but I found it is buggy...
(I'm not sure when bug 862395 will be fixed. But I think it is better to have a buggy but usable one than nothing.) |
Test branch updated: |
@janekptacijarabaci To my understanding, currently implementation in the test branch only allow notification when user grant permission to the site to do so. It just like calling I am not sure what you do consider this api should be. But I hope this one may work with different permission control to content scripts from the website. (And that is TM currently do. They always allow userscript show notifications) |
The question is how to do it... The Desktop Notification in Chrome (Tampermonkey) is different: System principal (chrome-privileged) should be granted permission. But... I don't have a better idea now... |
However I have made some attempt... Edited: See also bug 1263155 (1294332, 1306822)... |
FYI... |
So... Was it implemented or not? |
@VBelozyorov , I don't think it was implemented for 3.x. But for 4.x #2590 |
As a user script author I would love to be able to send clickable notifications to my users instead of alert on confirmation windows in many situations.
The text was updated successfully, but these errors were encountered: