update-data.sh 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. #!/bin/sh
  2. # Part of Zombie Navigator
  3. # Copyright © 2016 Zombie Navigator Developers
  4. cd "`dirname "$0"`"/..
  5. . ./version_info
  6. addon_version="`echo "$addon_version" | tr -d '~-'`"
  7. if [ "$addon_multiprocess" ] ; then
  8. multiprocess=',"multiprocess": true'
  9. else
  10. multiprocess=''
  11. fi
  12. git="`git show -s --pretty=format:%H 2>/dev/null | head -c 8`"
  13. touch ./src/build.meta
  14. [ "$git" ] && {
  15. version_git="+git.$git"
  16. printf '//Build:git-%s' "$git" > ./src/build.meta
  17. git_changes="`git status -s`"
  18. [ "$git_changes" ] && version_git="${version_git}+uncommitted"
  19. }
  20. [ "$addon_release_phase" = stable ] && version_git=''
  21. # TODO: Refactor things
  22. cat <<EOF | sed 's/^\s*//' | tr -d '\n' | sed 's/"\s*:\s*/":/g' > ./src/package.json
  23. {
  24. "title": "${addon_name}"
  25. ,"name": "${addon_id}"
  26. ,"version": "${addon_version}${version_git}"
  27. ,"description": "${addon_description}"
  28. ,"main": "index.js"
  29. ,"author": "${addon_author}"
  30. ,"engines": {
  31. "firefox": ">=38.0a1"
  32. }
  33. ,"license": "AGPL-3.0+"
  34. ,"permissions": {
  35. "private-browsing": true
  36. ${multiprocess}
  37. }
  38. ,"preferences": [
  39. {
  40. "name": "ignoreEnvironmentScript"
  41. ,"type": "bool"
  42. ,"value": false
  43. ,"hidden": true
  44. ,"title": "Deprecated"
  45. }
  46. ,{
  47. "name": "ignoreEnvironment"
  48. ,"type": "bool"
  49. ,"value": false
  50. ,"title": "Do not interpret environment variables"
  51. ,"description": "Scripts specified in a variable will be ignored. Enable if you don't need command-line access"
  52. }
  53. ,{
  54. "name": "hideSystemDetails"
  55. ,"type": "bool"
  56. ,"value": false
  57. ,"title": "Hide system details from Zombie scripts"
  58. ,"description": "Don't disclose real OS, browser version, etc. to Zombie scripts. Note: some of the values are available to content scripts. This option helps when you spoof those values to Web contents."
  59. }
  60. ,{
  61. "name": "allowApps"
  62. ,"type": "bool"
  63. ,"value": false
  64. ,"hidden": true
  65. ,"title": "Allow in-browser Zombie Navigator Apps"
  66. ,"description": "Enable if you want to use a Zombie Navigator App installed as a browser extension."
  67. }
  68. ,{
  69. "name": "policy.closeFinished"
  70. ,"type": "bool"
  71. ,"value": true
  72. ,"title": "Global policy: Close a Zombie window when finished"
  73. }
  74. ,{
  75. "name": "policy.downloads"
  76. ,"type": "bool"
  77. ,"value": true
  78. ,"title": "Global policy: Script-initiated file downloads"
  79. }
  80. ,{
  81. "name": "policy.screenshots"
  82. ,"type": "bool"
  83. ,"value": true
  84. ,"title": "Global policy: Scripted screenshots of window contents"
  85. }
  86. ,{
  87. "name": "policy.noBrowserURIs"
  88. ,"type": "bool"
  89. ,"value": false
  90. ,"title": "Global policy: Disallow the browser's internal pages"
  91. ,"description": "This keeps Zombie scripts from even just opening the affected pages (such as preferences)"
  92. }
  93. ,{
  94. "name": "policy.noBrowserScripts"
  95. ,"type": "bool"
  96. ,"value": true
  97. ,"title": "Global policy: No scripting on the browser's internal pages"
  98. ,"description": "Turn off to test the browser itself (Do it only if you know what you're doing!)"
  99. }
  100. ,{
  101. "name": "policy.noLocalURIs"
  102. ,"type": "bool"
  103. ,"value": false
  104. ,"title": "Global policy: Disable access to local files"
  105. ,"description": "Restrict access to file:// URIs"
  106. }
  107. ,{
  108. "name": "policy.privateBrowsingContext"
  109. ,"type": "menulist"
  110. ,"value": 0
  111. ,"title": "Global policy: Allowed scripting context"
  112. ,"description": "Types of windows Zombie scripts can open (Note that each script can only access its own Zombie windows)"
  113. ,"options": [
  114. {"value": 0, "label": "Normal and Private-Browsing windows"}
  115. ,{"value": 1, "label": "Only Normal windows"}
  116. ,{"value": 2, "label": "Only Private-Browsing windows"}
  117. ]
  118. }
  119. ,{
  120. "name": "policy.scriptTimeout"
  121. ,"type": "menulist"
  122. ,"value": -1
  123. ,"title": "Global policy: Script session timeout"
  124. ,"description": "Maximum length of a Zombie session. You can always terminate a script."
  125. ,"options": [
  126. {"value": -1, "label": "Unlimited (default)"}
  127. ,{"value": 60, "label": "1 minute"}
  128. ,{"value": 180, "label": "3 minutes"}
  129. ,{"value": 300, "label": "5 minutes"}
  130. ,{"value": 600, "label": "10 minutes"}
  131. ,{"value": 1800, "label": "30 minutes"}
  132. ,{"value": 3600, "label": "1 hour"}
  133. ,{"value": 7200, "label": "2 hours"}
  134. ,{"value": 10800, "label": "3 hours"}
  135. ,{"value": 21600, "label": "6 hours"}
  136. ,{"value": 43200, "label": "12 hours"}
  137. ,{"value": 86400, "label": "24 hours"}
  138. ]
  139. }
  140. ,{
  141. "name": "consoleLevel"
  142. ,"type": "menulist"
  143. ,"value": 1
  144. ,"title": "Console output"
  145. ,"options": [
  146. {"value": 3, "label": "All messages"}
  147. ,{"value": 2, "label": "Detailed"}
  148. ,{"value": 1, "label": "Important messages only (default)"}
  149. ,{"value": 0, "label": "Suppressed"}
  150. ]
  151. }
  152. ,{
  153. "name": "disableAddonUI"
  154. ,"type": "bool"
  155. ,"value": false
  156. ,"title": "Disable active addon UIs"
  157. ,"description": "Remove some active control elements from the addon's interfaces: no effect on Zombie scripts, recommended for noninteractive uses"
  158. }
  159. ,{
  160. "name": "showHelp"
  161. ,"type": "bool"
  162. ,"value": true
  163. ,"title": "Show help on startup"
  164. }
  165. ,{
  166. "name": "showHelpOnce"
  167. ,"type": "bool"
  168. ,"value": true
  169. ,"title": "Disable 'help on startup' once shown"
  170. }
  171. ,{
  172. "type": "control"
  173. ,"name": "button-help"
  174. ,"label": "Help"
  175. ,"title": "Show help now"
  176. }
  177. ,{
  178. "type": "control"
  179. ,"name": "button-license"
  180. ,"label": "Show"
  181. ,"title": "License information"
  182. }
  183. ,{
  184. "type": "control"
  185. ,"name": "button-dashboard"
  186. ,"hidden": true
  187. ,"label": "Dashboard"
  188. ,"title": "Zombie Navigator Status"
  189. ,"description": "See and control runnning scripts"
  190. }
  191. ,{
  192. "type": "control"
  193. ,"name": "button-stop"
  194. ,"label": "Stop"
  195. ,"title": "Terminate all running Zombie scripts now"
  196. }
  197. ,{
  198. "type": "file"
  199. ,"name": "temp-scriptPath"
  200. ,"title": "Run a Zombie script now"
  201. }
  202. ,{
  203. "type": "file"
  204. ,"name": "temp-scriptConfigPath"
  205. ,"hidden": true
  206. ,"title": "Execute a Zombie Script Configuration now"
  207. ,"description": "This is a special JSON file with instructions about how to run Zombie scripts. Zombie Navigator will run the script(s) as specified in it."
  208. }
  209. ]
  210. }
  211. EOF
  212. # vim: ts=4 noet ai