The idea is to create a WebExtension that allows one to become a Snowflake bridge by just installing it. That way it only suffices to install an extension and forget about it, unlike the approach of keeping a tab always open with the snowflake JS code.
Since it's based on WebExtensions it can be easily deployed for other browsers in their addon store.
I did try to make one myself but I don't have the expertise and time to debug all the problems that resulted. One of the important take aways that I learned in that process was that automatically loading scripts from external sites is prohibited and will result in the addon not passing the review in the addon store, so the snowflake.js and modernizr.js should be embedded with the addon. However, this would require modifying snowflake.js since when it's loaded locally it throws some typeError and doesn't show that there's some connection to snowflake.bamsoftware.com in the browser console. For debugging, to verify that the addon works as intended one may load it from about:debug and check about:networking in the DNS and WebSockets part.
For the implementation these resources should be loaded in the background to ensure a permanent state with this in the manifest.json,
"background": { "page": "pages/Snowflake.html" },
Trac: Username: oarel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Hey, I hand-made some wireframes to explore some ideas around this web extension. With this web extension, users will have the option to enable/disable snowflake. You can see them here:
If this extension is a browserAction kind of extension, we should have a toolbar button with a popup. If that is the case, users will be able to enable webRTC globally.
In this scenario, the user will enable snowflake in global settings and users will not get informed when snowflake is transferring.
A second option could be having this extension working per site as a pageAction extension. Then, when the user visits a website which has webRTC available, the snowflake icon appears at the right side of the URL Bar and when it is transferring turn into violet. On first time use, if webRTC is not enabled, we should prompt the Control Center doorhanger to allow users to enable webRTC.
Another option could be having both described above, running together. Here, the user can enable/disable snowflake globally on about:extensions. And, when webRTC is active in a site, then we can show the snowflake icon at the URL bar.
We could have Advanced Settings at the Extension Options page. There we can allow users to set some preferences about "how much of my bandwidth I want to give to snowflake" and another type of advanced network settings.
I think we can keep this idea raised in #27385 (moved) about to having the rotational motion on the snowflake when it is running.
I think that showing the number of peers connected to the bridge is rewarding for the user who is enabling the bridge. I also know that it is not possible now, but we can keep this in mind for later.
I think the snowflake icon should work better at small sizes. If you like to have that icon idea, I'll give it another round of work to synthesize the lines when it works small.
Next step for me is iterate over this mockups. Once we have defined how this extension will work, I'll create a prototype to see how the user flow works.
As arlolra mentioned, after some discussion and delays, snowflake is to be included in Cupcake as a replacement for flashproxy. There are other roadmap items, but those are pushed back pending funding. Cupcake has ~4000 users on Chrome, and a few dozen on Firefox (which needs to be rewritten).
Currently, when flashproxy is active, the cupcake becomes a happy cupcake with eyes and a mustache. I did a lot of user testing with movement and soft/subtle gradient shifts, but unfortunately they all proved too distracting to end-users. The mustache is just enough of a change to be noticeable but not enough to steal focus from page content. So for snowflake, a color change would probably work better than a rotation.
Discussion ongoing at $dayjob about potentially placing a Snowflake snippet onto one of our most popular sites. So if you wanted to turn the changes above into a smaller form factor for the website badge, that would look pretty great.
As arlolra mentioned, after some discussion and delays, snowflake is to be included in Cupcake as a replacement for flashproxy. There are other roadmap items, but those are pushed back pending funding. Cupcake has ~4000 users on Chrome, and a few dozen on Firefox (which needs to be rewritten).
Wow that's awesome!
So for snowflake, a color change would probably work better than a rotation.
Yes, the main idea is having both: When it is disabled is grey, when it is enabled is violet and when it is enabled with clients, then we can add the rotation.
Here are some links to MassBrowser, a project by a University of Massachusetts research group on Browser-based proxies. I don't think it's a web extension, but some of the features available to proxies (being able to decide how much bandwidth to provide, what kinds of exit traffic to support, etc.) would be interesting to look into as features for the web extension.
I just started looking at #27385 (moved) as well. I noticed you're making changes in the /proxy directory of snowflake.git. Was the plan to tackle both this ticket and #27385 (moved) at once?
I just started looking at #27385 (moved) as well. I noticed you're making changes in the /proxy directory of snowflake.git. Was the plan to tackle both this ticket and #27385 (moved) at once?
No, I can look into that after if you want.
My plan was to reuse, wherever possible, the same code for both the badge and the webextension, which inevitably means some refactoring will touch other files in proxy/.
If you're going to do that simultaneously, maybe I should merge what I have so far and we can coordinate a tighter review timeline so there are less conflicts?
It looks good so far. I like the refactoring changes. If it makes things easier re #27385 (moved), I'm fine with merging what's been changed so far.
I built the WebExtension by running cake.coffeescript webext in the proxy directory. Then I loaded it into Firefox by going to about:debugging, clicking "Load Temporary Add-on", and selecting manifest.json.
The browser console (Ctrl+Shift+J) shows a couple of warnings that I don't immediately know how to interpret, and also text showing that tmp.js isn't working to set the opt-in cookie.
1557301394666 addons.webextension.280b152ec6e19b8aec7a29eebdd1af8e61a85964@temporary-addon WARN Loading extension '280b152ec6e19b8aec7a29eebdd1af8e61a85964@temporary-addon': Reading manifest: Error processing background.persistent: Event pages are not currently supported. This will run as a persistent background page.1557301394692 addons.webextension.280b152ec6e19b8aec7a29eebdd1af8e61a85964@temporary-addon WARN Please specify whether you want browser_style or not in your browser_action options.Snowflake: == snowflake proxy ==Snowflake: Not opted-in. Please click the badge to change options.Snowflake: Currently not active.
It works for me in Chromium. I seem to remember that the cookie thing is one of the incompatibilities between Firefox and Chromium. I remember encountering this problem when I spent a little time trying to hack together a WebExtension, but I don't remember if I figured it out or not. One thing to try would be cookies.set with a url from runtime.getURL. Of course, if you're planning to refactor the opt-in so that the WebExtension doesn't even need a cookie to work, that's better.
Of course, if you're planning to refactor the opt-in so that the WebExtension doesn't even need a cookie to work, that's better.
Yes, that will be the next thing I do. Split up the initialization so that the badge/node/webextension build their own. Thetmp.js was just a hack to get things started.
I just started looking at #27385 (moved) as well. I noticed you're making changes in the /proxy directory of snowflake.git. Was the plan to tackle both this ticket and #27385 (moved) at once?
No, I can look into that after if you want.
My plan was to reuse, wherever possible, the same code for both the badge and the webextension, which inevitably means some refactoring will touch other files in proxy/.
If you're going to do that simultaneously, maybe I should merge what I have so far and we can coordinate a tighter review timeline so there are less conflicts?
Thanks for the merge! If you think you can make the changes for #27385 (moved) easily in a way that will match the WebExtension and it sounds like a fun task please feel free to do so. I can help out here but it will also take me longer to get up to speed with how the coffeescript proxy works.
There are other things like setting it up for localization that I can work on once the UI is set :)
It's getting closer to a point where there's a cleaner separation between what's library code and what's necessary for each of the use cases.
If you think you can make the changes for #27385 (moved) easily in a way that will match the WebExtension and it sounds like a fun task please feel free to do so. I can help out here but it will also take me longer to get up to speed with how the coffeescript proxy works.
Ok, I'll try and tackle that next.
There are other things like setting it up for localization that I can work on once the UI is set :)
We now have a final deadline (July 26) for getting this done in time for Roger's Defcon talk from which we will try to get volunteers.
@arlolra: do you have a good idea of when you'll be able to work on this? I'm happy to jump in and help if you're running low on time, but I don't want to step on your toes.
do you have a good idea of when you'll be able to work on this?
I will have lots of time starting July 1, leading up to the meeting in Stockholm. Before then I will continue to make steady progress though ... but keep me honest about that.
I'm happy to jump in and help if you're running low on time, but I don't want to step on your toes.
It would be helpful if you tried it out in its current state and provided feedback.
It would be helpful if you tried it out in its current state and provided feedback.
I installed the extension (based on commit 7989810) in Firefox 67.0.2. The snowflake icon shows up in my toolbar but it keeps saying "Offline."
In the browser console, I see the following:
1560530472019 addons.xpi WARN Addon with ID 494b27b305cec4fbca825a9f4cca849518e73f41@temporary-addon already installed, older version will be disabledSnowflake: == snowflake proxy == snowflake.js:1134:13Snowflake: Using snowflake.bamsoftware.com:443 as Relay. snowflake.js:1134:13Snowflake: ProxyPair Slots: 1 snowflake.js:1134:13Snowflake: Snowflake IDs: 6r3t6xpg4g8 snowflake.js:1134:13XML Parsing Error: no root element foundLocation: https://snowflake-broker.bamsoftware.com/proxyLine Number 1, Column 1: proxy:1:1XML Parsing Error: no root element foundLocation: https://snowflake-broker.bamsoftware.com/proxyLine Number 1, Column 1: proxy:1:1XML Parsing Error: no root element foundLocation: https://snowflake-broker.bamsoftware.com/proxyLine Number 1, Column 1:...
I could also install the extension in both Chromium and Google Chrome but my icon says "Offline" there as well.
The snowflake icon shows up in my toolbar but it keeps saying "Offline."
That just means that no client is connected. See the mockups in comment:5
Until #25601 (moved) is implemented, it's a binary state.
But, this has been a useful exercise since clearly the messaging needs improvement.
Were there plans to have another state to indicate that the proxy is polling for clients and therefore ready to accept them? As a user it is a bit confusing to see the "offline" state and wonder whether I'm in a position to be useful or whether I need to enable something.
But, this has been a useful exercise since clearly the messaging needs improvement.
As a semi-ignorant user, I would expect the icon to take on one of three states:
Disconnected, meaning that my proxy isn't able to talk to the broker.
Waiting, meaning that my proxy is able to poll the broker and waiting for clients.
Proxying, meaning that I'm currently serving a client.
The ability to toggle between Disconnected and Waiting sounds reasonable.
I think we should also let the user know how useful their proxy has been. Maybe something along the lines of "Your snowflake helped X users circumvent censorship in the last 24 hours."
I think we should also let the user know how useful their proxy has been. Maybe something along the lines of "Your snowflake helped X users circumvent censorship in the last 24 hours."
I'm happy to jump in and help if you're running low on time, but I don't want to step on your toes.
I'm going to file individual task from here on out to avoid licking all the cookies. It would be good if others were familiar with developing the webextension.