web-push-libs / web-push Goto Github PK
View Code? Open in Web Editor NEWWeb Push library for Node.js
License: Other
Web Push library for Node.js
License: Other
Register for notifications, close browser, send notification, open browser, check if notification has arrived.
Currently the version is hardcoded in the selenium-init script, so once a new Firefox Nightly version will be released, the script will be broken.
We could download it automatically and then do:
var firefox = require('selenium-webdriver/firefox');
var binary = new firefox.Binary('/path/to/firefox-bin');
var options = new firefox.Options().setBinary(binary);
var driver = new firefox.Driver(options);
Instead of:
var driver = new webdriver.Builder()
.forBrowser('firefox')
.build();
I guess this could be useful for apps targeting older versions of Firefox OS.
Currently, we don't check if the files defined in importScripts actually exist and we directly add the code to import them in the service worker.
We should check if they exist and throw an exception or print a warning message if they don't.
We could add this feature either to oghliner or sw-precache, @mykmelez what do you think? It really depends on whether we plan to remove the dependency on sw-precache in the future.
The sendNotification
tests should be extended to test the GCM case as well.
We could install the Mozilla push server and test that our library is able to communicate with it.
They're very timing-dependent at the moment (the notification could arrive before the page has been loaded), we need a way to make them reliable.
As suggested here: SeleniumHQ/selenium#1100
There are strings enclosed in double quotes and other strings in single quotes. I prefer single quotes.
Very low priority.
undefined:1178
vlog(2, () => this + ' scheduling notifications', this);
^
SyntaxError: Unexpected token )
at goog.loadModuleFromSource_ (/home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/lib/goog/base.js:1123:19)
at Object.goog.loadModule (/home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/lib/goog/base.js:1085:46)
at /home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/lib/webdriver/promise.js:1:6
at Object.exports.runInContext (vm.js:64:17)
at Object.Context.closure.goog.retrieveAndExecModule_ (/home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/_base.js:135:8)
at <anonymous>:1:6
at Object.exports.runInContext (vm.js:64:17)
at Context.closure.closure.vm.createContext.CLOSURE_IMPORT_SCRIPT (/home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/_base.js:104:12)
at Object.goog.importScript_ (/home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/lib/goog/base.js:879:9)
at Object.goog.importModule_ (/home/travis/build/marco-c/web-push/node_modules/selenium-webdriver/lib/goog/base.js:900:14)
npm ERR! Test failed. See above for more details.
This should be tested both in Firefox and in Chrome.
The GCM API key is a secure environment variable, so it can't be used in pull requests. Because of this, Chrome tests will always fail in pull requests.
I'd like to build a test that makes it possible to exercise the entire stack.
I'm not sure how to build such a test, maybe with SlimerJS.
Currently tests are working on Linux.
I failed to make it work on OSX without changing selenium-init.js
We can either create a .npmignore
file (such as https://github.com/socketio/socket.io/blob/master/.npmignore) or explicitely list the files we want to export (e.g. https://github.com/senchalabs/connect/blob/master/package.json or https://github.com/strongloop/express/blob/master/package.json).
They're hard to detect otherwise.
Using the info the push service returns (webpush-wg/webpush-protocol#60).
For now, only https://github.com/marco-c/tictactoe/
Depends on #51.
Make sure the implementation works with empty messages.
There's a distinction between notifications without a message and notifications with an empty message:
mozilla-services/autopush#132 (comment)
w3c/push-api#161
On Linux, I'm creating a policy file. On OS X creating a policy file is a little more complicated, I don't know if it's feasible on Travis.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.