Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: pages/address-masking.md

Issue 29773577: Fixes #68 - Implemented address masking script (Closed) Base URL: https://hg.adblockplus.org/website-defaults
Left Patch Set: Created May 7, 2018, 5:49 p.m.
Right Patch Set: Addressed #3 Created May 7, 2018, 11:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | pages/index.html » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 title=Address Masking 1 title=Address Masking
2 description=Use address masking to avoid spam. 2 description=Use address masking to avoid spam.
3 3
4 # Address masking 4 # Address masking
5 5
6 Use address masking to avoid spam. 6 Use address masking to avoid spam.
7 7
8 ## Usage 8 ## Usage
9 9
10 ### Step 1: Include script on page
11
12 Include the following script at the bottom of a page:
13
10 ``` 14 ```
11 // 1. Base64 encoded sensitive address 15 <script src="/js/address-masking.js"></script>
ire 2018/05/07 23:02:23 NIT: Why not separate the code blocks so the title
juliandoucette 2018/05/07 23:51:39 Done.
16 ```
12 17
13 btoa("mailto:username@example.com") 18 ### Step 2: Base64 encode addresses
14 19
15 // 2. Place encoded address inside `data-address` 20 Base64 encode sensitive `href` addresses into `data-address` attributes.
16 21
22 #### Markdown (before processing)
23
24 ```
25 [Private Email](#){: data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t" }
26 ```
27
28 #### HTML (before processing)
29
30 ```
17 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a> 31 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a>
32 ```
18 33
19 // 3. Include `static/js/address-masking.js` 34 #### Output (after processing)
20 35
21 <script src="static/js/address-masking.js"></script> 36 ```
22
23 // 4. See `data-address` decoded into `href` appropriately
24
25 <a href="mailto:username@example.com">Private Email</a> 37 <a href="mailto:username@example.com">Private Email</a>
26 ``` 38 ```
27 39
28 ## Example 40 ## Example
29 41
30 <script src="/js/address-masking.js"></script> 42 <script src="/js/address-masking.js"></script>
31 43
32 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a> 44 <a data-address="bWFpbHRvOnVzZXJuYW1lQGV4YW1wbGUuY29t">Private Email</a>
ire 2018/05/07 23:02:23 What about when there is no JS? This makes the lin
juliandoucette 2018/05/07 23:51:39 Yep :( ... I don't see a Frontend way around that.
ire 2018/05/09 05:19:54 Yeah, I'm not sure of a solution to this either. C
juliandoucette 2018/05/15 09:53:36 <julian> judith: Is it a problem if our phone numb
ire 2018/05/15 15:12:07 A reason for no-js you didn't mention was performa
LEFTRIGHT
« no previous file | pages/index.html » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld