-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaddpref
executable file
·87 lines (81 loc) · 2.02 KB
/
addpref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
show_help() {
echo 'addpref <debug|enable-sw|disable-sw|god|nogod|skia|noskia|marionette|logs|rehash-manifest|selection>'
echo 'addpref <key> <value>'
echo " Put value between single _and_ double quotes if it's a string."
echo 'addpref <help|-help|--help>'
}
addpref() {
key="$1"
value="$2"
echo "Waiting for device..."
adb wait-for-device
adb shell <<-EOF
stop b2g
cd /data/b2g/mozilla/*.default/
echo 'user_pref("$key", $value);' >> prefs.js
start b2g
exit
EOF
}
if [ -z "$1" ] ; then
echo "ERROR: Please supply at least one argument."
show_help
exit 1
fi
case "$1" in
debug)
addpref 'devtools.debugger.forbid-certified-apps' 'false'
addpref 'devtools.debugger.prompt-connection' 'false'
;;
skia)
addpref 'gfx.canvas.azure.accelerated' 'true'
;;
noskia)
addpref 'gfx.canvas.azure.accelerated' 'false'
;;
marionette)
addpref 'marionette.defaultPrefs.enabled' 'true'
;;
logs)
addpref 'ril.debugging.enabled' 'true'
addpref 'mms.debugging.enabled' 'true'
addpref 'network.debugging.enabled' 'true'
addpref 'dom.mozApps.debug' 'true'
;;
rehash-manifest)
addpref 'gecko.buildID' '"1"'
;;
selection)
addpref 'selectioncaret.enabled' 'on'
addpref 'selectioncaret.noneditable' 'on'
;;
god)
addpref 'dom.apps.developer_mode' 'true'
;;
ungod)
addpref 'dom.apps.developer_mode' 'false'
;;
enable-sw)
addpref 'dom.serviceWorkers.interception.enabled' 'true'
addpref 'devtools.webconsole.filter.serviceworkers' 'true'
addpref 'dom.serviceWorkers.enabled' 'true'
;;
disable-sw)
addpref 'dom.serviceWorkers.interception.enabled' 'false'
addpref 'devtools.webconsole.filter.serviceworkers' 'false'
addpref 'dom.serviceWorkers.enabled' 'false'
;;
help|-help|--help)
show_help
exit 0
;;
*)
if [ -z "$2" ] ; then
echo "ERROR: Please supply 2 arguments if you don't use a shortcut."
show_help
exit 1
fi
addpref "$1" "$2"
;;
esac