Advertisement
metalx1000

Chrome Extension Template Maker

Apr 24th, 2016
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.84 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "What is the domain (example: filmsbykris.com)?"
  4. read domain
  5.  
  6. echo "What is the title of your extention?"
  7. read title
  8.  
  9. if [ -d "$title" ]
  10. then
  11.   echo "Folder already exists..."
  12.   echo "Exiting..."
  13.   exit 1
  14. fi
  15.  
  16. mkdir "$title"
  17. cd "$title"
  18.  
  19. cat << EOF > manifest.json
  20. {
  21.    "content_scripts": [ {
  22.       "js": [ "jquery.min.js", "main.js" ],
  23.       "matches": [ "*://domain/*"]
  24.    } ],
  25.    "description": "title",
  26.    "manifest_version": 2,
  27.    "name": "title",
  28.    "version": "0.1"
  29. }
  30. EOF
  31.  
  32. sed -i "s/title/$title/g" manifest.json
  33. sed -i "s/domain/$domain/g" manifest.json
  34.  
  35. cat << EOF > main.js
  36. \$(document).ready(function(){
  37.   console.log("Script Running...");
  38. });
  39. EOF
  40.  
  41. echo "Downloading jQuery..."
  42. wget -q "https://code.jquery.com/jquery-2.2.3.min.js" -O jquery.min.js
  43.  
  44. echo "Complete..."
  45. echo "Good-Bye"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement