This repository was archived by the owner on Jun 3, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +82
-35
lines changed Expand file tree Collapse file tree 9 files changed +82
-35
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ exports . id = 'com.add0n.stylus' ;
4+
35exports . ids = {
46 chrome : [
57 'hhdaknihlbgjoaiaceldhnbbmogabcpk' , // Stylus External Editor Integration (Chrome)
6- 'djlnckfpakjlpfddhboajjmaeljfaacn ' , // Stylus External Editor Integration (Opera)
8+ 'bfkhfaldfclkfjdmgfibhknpoiaoelih ' , // Stylus External Editor Integration (Opera)
79 ] ,
810 firefox : [
911 '95fce6c2e847856344b2156491239d95f56c7fc1@temporary-addon' , // Stylus External Editor Integration
Original file line number Diff line number Diff line change 1414 ../node/x86/node install.js --add_node $1
1515 fi
1616fi
17-
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ function exists (directory, callback) {
4040 one ( ) ;
4141}
4242
43- var dir = path . join ( share , 'com.add0n.stylus ') ;
44- var name = 'com.add0n.stylus' ;
45- var ids = require ( './config.js' ) . ids ;
43+ var { id , ids } = require ( './config.js ') ;
44+ var dir = path . join ( share , id ) ;
45+ var name = id ;
4646
4747function manifest ( root , type , callback ) {
4848 console . log ( ' -> Creating a directory at' , root ) ;
Original file line number Diff line number Diff line change 11#! /bin/bash
2- #
3- rm ~ /.config/google-chrome/NativeMessagingHosts/com.add0n.stylus.json
4- rm ~ /.config/chromium/NativeMessagingHosts/com.add0n.stylus.json
5- rm ~ /.mozilla/native-messaging-hosts/com.add0n.stylus.json
6- rm -r ~ /com.add0n.stylus
72
3+ cd ./app
4+
5+ MACHINE_TYPE=` uname -m`
6+ if [ ${MACHINE_TYPE} == ' x86_64' ]; then
7+ id=` ../node/x64/node -e " process.stdout.write(require('./config.js').id)" `
8+ else
9+ id=` ../node/x86/node -e " process.stdout.write(require('./config.js').id)" `
10+ fi
11+
12+ echo " Native Client id is \" ${id} \" "
13+ echo
14+
15+ echo " .. Removing manifest file for Google Chrome"
16+ rm ~ /.config/google-chrome/NativeMessagingHosts/${id} .json
17+ echo " .. Removing manifest file for Chromium"
18+ rm ~ /.config/chromium/NativeMessagingHosts/${id} .json
19+ echo " .. Removing manifest file for Mozilla Firefox"
20+ rm ~ /.mozilla/native-messaging-hosts/${id} .json
21+ echo " .. Removing executable"
22+ rm -r ~ /${id}
23+
24+ echo
825echo " >>> Native Client is removed <<<" .
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ function exists (directory, callback) {
4040 one ( ) ;
4141}
4242
43- var dir = path . join ( share , 'com.add0n.stylus ') ;
44- var name = 'com.add0n.stylus' ;
45- var ids = require ( './config.js' ) . ids ;
43+ var { id , ids } = require ( './config.js ') ;
44+ var dir = path . join ( share , id ) ;
45+ var name = id ;
4646
4747function manifest ( root , type , callback ) {
4848 console . log ( ' -> Creating a directory at' , root ) ;
Original file line number Diff line number Diff line change 11#! /bin/bash
2- #
3- rm ~ /Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.add0n.stylus.json
4- rm ~ /Library/Application\ Support/Chromium/NativeMessagingHosts/com.add0n.stylus.json
5- rm ~ /Library/Application\ Support/Mozilla/NativeMessagingHosts/com.add0n.stylus.json
6- rm -r ~ /com.add0n.stylus
72
3+ cd ./app
4+
5+ MACHINE_TYPE=` uname -m`
6+ if [ ${MACHINE_TYPE} == ' x86_64' ]; then
7+ id=` ../node/x64/node -e " process.stdout.write(require('./config.js').id)" `
8+ else
9+ id=` ../node/x86/node -e " process.stdout.write(require('./config.js').id)" `
10+ fi
11+
12+ echo " Native Client id is \" ${id} \" "
13+ echo
14+
15+ echo " .. Removing manifest file for Google Chrome"
16+ rm ~ /Library/Application\ Support/Google/Chrome/NativeMessagingHosts/${id} .json
17+ echo " .. Removing manifest file for Chromium"
18+ rm ~ /Library/Application\ Support/Chromium/NativeMessagingHosts/${id} .json
19+ echo " .. Removing manifest file for Mozilla Firefox"
20+ rm ~ /Library/Application\ Support/Mozilla/NativeMessagingHosts/${id} .json
21+ echo " .. Removing executable"
22+ rm -r ~ /${id}
23+
24+ echo
825echo " >>> Native Client is removed <<<" .
Original file line number Diff line number Diff line change @@ -15,9 +15,19 @@ function exists (directory, callback) {
1515 } ) ;
1616}
1717
18- var dir = path . join ( process . argv [ 2 ] , 'com.add0n.stylus' ) ;
19- var name = 'com.add0n.stylus' ;
20- var ids = require ( './config.js' ) . ids ;
18+ var { id, ids} = require ( './config.js' ) ;
19+ var dir = path . join ( process . argv [ 2 ] , id ) ;
20+ var name = id ;
21+
22+ var { exec} = require ( 'child_process' ) ;
23+
24+ console . log ( '.. Writting to Chrome Registry' ) ;
25+ console . log ( `.. Key: HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts\\${ id } ` ) ;
26+ exec ( `REG ADD "HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts\\${ id } " /ve /t REG_SZ /d "%LocalAPPData%\\${ id } \\manifest-chrome.json" /f` ) ;
27+
28+ console . log ( `.. Writting to Firefox Registry` ) ;
29+ console . log ( `.. Key: HKCU\\SOFTWARE\\Mozilla\\NativeMessagingHosts\\${ id } ` ) ;
30+ exec ( `REG ADD "HKCU\\SOFTWARE\\Mozilla\\NativeMessagingHosts\\${ id } " /ve /t REG_SZ /d "%LocalAPPData%\\${ id } \\manifest-firefox.json" /f` ) ;
2131
2232function manifest ( type , callback ) {
2333 exists ( dir , ( e ) => {
Original file line number Diff line number Diff line change 11@ echo off
22
3- ECHO .. Writting to Chrome Registry
4- ECHO .. Key: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.stylus
5- REG ADD " HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.stylus" /ve /t REG_SZ /d " %LocalAPPData% \com.add0n.stylus\manifest-chrome.json" /f
6-
7- ECHO .. Writting to Firefox Registry
8- ECHO .. Key: HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.stylus
9- FOR %%f in (" %LocalAPPData% " ) do SET SHORT_PATH = %%~sf
10- REG ADD " HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.stylus" /ve /t REG_SZ /d " %SHORT_PATH% \com.add0n.stylus\manifest-firefox.json" /f
11-
123pushd " %~dp0 "
134CD app
145
Original file line number Diff line number Diff line change 11@ echo off
22
3+ pushd " %~dp0 "
4+ CD app
5+
6+ IF " %PROCESSOR_ARCHITECTURE% " == " AMD64" (
7+ FOR /f %%i in ('..\node\x64\node.exe -e " process.stdout.write(require('./config.js').id)" ') do SET id = %%i
8+ ) ELSE (
9+ FOR /f %%i in ('..\node\x86\node.exe -e " process.stdout.write(require('./config.js').id)" ') do SET id = %%i
10+ )
11+
12+ echo sss%id%
13+
314echo .. Deleting Chrome Registry
4- REG DELETE " HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.stylus " /f
15+ REG DELETE " HKCU\Software\Google\Chrome\NativeMessagingHosts\%id% " /f
516
617echo .. Deleting Firefox Registry
718for %%f in (" %LocalAPPData% " ) do SET SHORT_PATH = %%~sf
8- REG DELETE " HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.stylus " /f
19+ REG DELETE " HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\%id% " /f
920
10- echo .. Deleting com.add0n.stylus
11- RMDIR /Q /S " %LocalAPPData% \com.add0n.stylus "
21+ echo .. Deleting %id%
22+ RMDIR /Q /S " %LocalAPPData% \%id% "
1223
1324echo .
14- echo ^ > ^ > ^ > Done! ^ < ^ < ^ <
25+ echo ^ > ^ > ^ > Native Client is removed ^ < ^ < ^ <
1526echo .
1627pause
1728
You can’t perform that action at this time.
0 commit comments