Forking what is left of ZeroNet and hopefully adding an AT Proto Frontend/Proxy
1import re
2from Plugin import PluginManager
3
4# Warning: If you modify the donation address then renmae the plugin's directory to "MyDonationMessage" to prevent the update script overwrite
5
6
7@PluginManager.registerTo("UiRequest")
8class UiRequestPlugin(object):
9 # Inject a donation message to every page top right corner
10 def renderWrapper(self, *args, **kwargs):
11 body = super(UiRequestPlugin, self).renderWrapper(*args, **kwargs) # Get the wrapper frame output
12
13 inject_html = """
14 <style>
15 #donation_message { position: absolute; bottom: 0px; right: 20px; padding: 7px; font-family: Arial; font-size: 11px }
16 </style>
17 <a id='donation_message' href='https://blockchain.info/address/1QDhxQ6PraUZa21ET5fYUCPgdrwBomnFgX' target='_blank'>Please donate to help to keep this ZeroProxy alive</a>
18 </body>
19 </html>
20 """
21
22 return re.sub(r"</body>\s*</html>\s*$", inject_html, body)