embed.html should be the go to for embedding snowflake badges in webpages but it currently has a couple of problems,
No description, nothing to suggest to the lambda visitor about what to do.
Clicking on the badge redirects to the options page hosted in torproject.org, but this means that users who have first-party isolation manually enabled (as can be done in Firefox) won't be able to enable it on the page where embed.html is embedded.
Ideally what should be done is:
Small description ("Do you want to help censored users access the Tor network?") with a snowflake logo.
If user clicks on yes, then in that same iframe there's some JS check to see if WebRTC is disabled, if it is inform the user that WebRTC is necessary and perhaps add a link on how to enable it back.
If WebRTC is enabled, then load up snowflake.js and modernizr.js. Description should contain if the connection to the broker is done and is waiting for a client request, and if it is then maybe the logo should change as well as the description. (Since everything is done on the same page then there won't be any problems with first party isolation -- except with 3rd party cookies disabled)
Ideally it should be easy to embed into webpages if what's above is done, and should be small enough.
(cc'ing antonela of the ux-team for her opinions :)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
hey, thanks for inviting me to the party! I have been playing/reading with/about snowflake, and I have some ideas. Is it this work attached to any deadline?
Is it this work attached to any deadline?
There is no dedicated snowflake maintainer currently so the answer is most probably no. That said I heard recently from a ~150K Alexa rank website owner that he wanted to include snowflake embeds in his site (which prompted me to open this ticket), so if this can be done early it would be nice.
Volunteers visit websites which host the “snowflake” proxy (where does it happen? On Tor Browser? any browser?).
Tor clients (do you mean relays or the browser?) automatically find available browser proxies via the Broker (the domain fronted signaling channel).
Tor client and browser proxy establish a WebRTC peer connection (where?).
Proxy connects to some relay (to another tor client?).
Tor occurs (what it means? that tor gets 100% bootstrapped?).
So, we have two types of users:
people who host snowflake
people who "activate" snowflake
Lets back to the 1. item, what do you need from users at this moment?
Do we want users clicking at the snowflake badge to open a new tab?
In which of the above steps does occur that the user clicks at the badge and get moved to [https://keroserene.net/snowflake/options.html]? And, when the user arrives there, what we need?
We need the browser client with webRTC enabled.
We need a user who agreed on saving the world - clicked on YES.
I'm experimenting with using a natural-language user interface to improve options.html. The action is very simple and I don't think we need any more UI artifact to encourage the user’s action.
0
Do you want to help censored users access the Tor network?
Some description of what is happening. You can go a bit technical here.
[Yes] [I want to learn more]
1
We need WebRTC to work. [Enable WebRTC]
2.0
Snowflake Proxy is ACTIVE. Thank you for contributing to internet freedom! [OFF Snowflake]
2.1
Snowflake Proxy is OFF. Do you want to help censored users access the Tor network? [Activate Snowflake]
** The badge**
I made two options for a better badge. Can we still animate it when is enabled like now? Can I animate it with a little css? What do you think about to have it rotating when is active? :)
Tor occurs (what it means? that tor gets 100% bootstrapped?).
Yes. What it really means is that a circuit [User -> Snowflake proxy -> Snowflake bridge -> Middle relay -> Exit relay] gets created.
So, we have two types of users:
people who host snowflake
people who "activate" snowflake
Lets back to the 1. item, what do you need from users at this moment?
Do we want users clicking at the snowflake badge to open a new tab?
I'm personally against such a design (you want the whole snowflake setup to be fluid and not send them to some other page again). That's also similar to what dcf is thinking on #25722 (moved)
I propose that both these pages should have a Yes/No button right there on the page. Clicking Yes should do both: set the opt-in cookie start up the proxy (without needing to refresh the page)
In which of the above steps does occur that the user clicks at the badge and get moved to [https://keroserene.net/snowflake/options.html]? And, when the user arrives there, what we need?
We need the browser client with webRTC enabled.
We need a user who agreed on saving the world - clicked on YES.
I'm experimenting with using a natural-language user interface to improve options.html. The action is very simple and I don't think we need any more UI artifact to encourage the user’s action.
0
Do you want to help censored users access the Tor network?
Some description of what is happening. You can go a bit technical here.
[Yes] [I want to learn more]
1
We need WebRTC to work. [Enable WebRTC]
2.0
Snowflake Proxy is ACTIVE. Thank you for contributing to internet freedom! [OFF Snowflake]
2.1
Snowflake Proxy is OFF. Do you want to help censored users access the Tor network? [Activate Snowflake]
The design is much better, and this would describe the options.html page.
For the embed.html one it should have ideally a maximum of 280px in width. Also a "Learn More" link in the bottom corner sounds interesting as well.
** The badge**
I made two options for a better badge. Can we still animate it when is enabled like now? Can I animate it with a little css? What do you think about to have it rotating when is active? :)
If we export/use svgs, then the site owners can customize the snowflake icon color so easy.
Animate the logo sounds nice :) There are basically five states:
The one who wants to become a snowflake proxy (call him D) waits for a Tor snowflake user (call him F).
D successfully connects to F.
F is browsing on Tor so there's data transfer to D.
F is idle so there are no data transfers.
F quits and after a timeout D disconnects and goes back to the first step.
You could have the logo animating when it first connects with a message "Connected" or something like that, then the logo stops and only rotates when it's in the 3rd state above, and you could have the messages "transferring" "idle" (this is not necessary for a first version, but it may be interesting later on so that the one who runs the proxy knows when someone is connecting).
There are basically five states:
The one who wants to become a snowflake proxy (call him D) waits for a Tor snowflake user (call him F).
D successfully connects to F.
F is browsing on Tor so there's data transfer to D.
F is idle so there are no data transfers.
F quits and after a timeout D disconnects and goes back to the first step.
Wondering if we can add a new snowflake each time a new user gets connected to the proxy/bridge. They will make a cool pattern of snowflakes rotating :)
I used a .svg so you can change the fill color via css.
There are basically five states:
The one who wants to become a snowflake proxy (call him D) waits for a Tor snowflake user (call him F).
D successfully connects to F.
F is browsing on Tor so there's data transfer to D.
F is idle so there are no data transfers.
F quits and after a timeout D disconnects and goes back to the first step.
Great, that gives us:
waiting [white]
no transferring [fuscia]
connected [green]
transferring [green + rotate]
transferring with peers [+1 white + rotate]
I would add a state separate from "waiting" to represent when the proxy is disabled because the user has not opted in. I don't think it's worth distinguishing the states "connected and idle" and "connected and transmitting". It's not well-defined anyway, because a proxy can have multiple connections, some idle and some transmitting. I don't understand the difference between "transferring" and "transferring with peers"--what's a peer?
These are the states I am thinking of:
disabled because not opted in
disabled because of an error (e.g. missing JS, missing WebRTC, unhandled exception)
enabled, no clients
enabled, at least one client (could depict the number of clients)
I'm not sure how this idea ties into the above prototypes and requirements, but it might be nice to have something more than the "you aren't being helpful right now" and "you are helping someone now" binary situation.
Specifically, if I turn on my snowflake and go to sleep and wake up and look, and it's on "nope not helpful", I have no idea whether I've been helpful anytime in the past.
So it would be interesting to consider changing the icon over time to reflect not just current state right now, but past contributions.
(The idea came about based on antonela's sentence above about "adding" a snowflake.)
Overall, I like the code changes and refactors. Smaller commits in the future would be easier to review for changes like this where it's hard to piece together which code was just moved around and where the logic changed.
It looks like cp -r static/{embed.html,embed.css,popup.js,icons} webext/ isn't running properly for some reason. When I run it manually it works, but when I ran npm run webext to build it, the files didn't copy and it fails with the error
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
A few comments on the refactoring:
WebExtUI and BadgeUI classes were moved to init-webext.js and init-badge.js, respectively, but DebugUI is still in ui.js. To follow the pattern, should DebugUI be moved to init-test.js? That leaves ui.js pretty sparse...
Smaller commits in the future would be easier to review for changes like this where it's hard to piece together which code was just moved around and where the logic changed.
Sorry, I was working on this on the last day of the meeting and just pushed what I had since it wasn't clear when I'd be able to get back to it.
When I run it manually it works, but when I ran npm run webext to build it, the files didn't copy and it fails with the error
Where are getting this error? I'm not able to reproduce it.
When I run it manually it works, but when I ran npm run webext to build it, the files didn't copy and it fails with the error
Where are getting this error? I'm not able to reproduce it.
If I clean the webext directory to remove all nontracked files, and then run npm run webext, the embed.css and embed.html files don't copy over... is this the right way to build the webextenson? It's possible this is just a problem for me locally. I'm using npm version '6.9.0'
Also, maybe not as a part of these changes though, we should probably update the README with insructions to build the webextension
It's possible this is just a problem for me locally. I'm using npm version '6.9.0'
I installed that version of npm and it seemed to work for me. What version of node? It's odd that invoking the command manually wasn't an issue. I should test in a different OS.
Also, maybe not as a part of these changes though, we should probably update the README with insructions to build the webextension
It's possible this is just a problem for me locally. I'm using npm version '6.9.0'
I installed that version of npm and it seemed to work for me. What version of node? It's odd that invoking the command manually wasn't an issue. I should test in a different OS.
My host machine is ubuntu 18.04 with node v10.16.0, and I ran it in snowbox which is debian with node v12.1.0
Also, maybe not as a part of these changes though, we should probably update the README with insructions to build the webextension