Skip to content

Instantly share code, notes, and snippets.

@entrptaher
Last active January 17, 2018 07:34
Show Gist options
  • Save entrptaher/276634474d298a019f1f9665abfe245f to your computer and use it in GitHub Desktop.
Save entrptaher/276634474d298a019f1f9665abfe245f to your computer and use it in GitHub Desktop.

Step 1

  • Go here https://console.developers.google.com/apis/api/chromewebstore/overview
  • Create a project.
  • Go here again https://console.developers.google.com/apis/api/chromewebstore/overview
  • Credentials > Create Credentials > Oauth Client ID
  • Configure Concent Screen
  • Enter yourextensionname
  • Select Other > then click Create
  • Save clientId and clientSecret

Step 2

  • Copy this below in a notepad and Replace the YOUR_CLIENT_ID with the clientId we got from above step 1.
  • https://accounts.google.com/o/oauth2/auth?client_id=YOUR_CLIENT_ID&response_type=code&scope=https://www.googleapis.com/auth/chromewebstore&redirect_uri=urn:ietf:wg:oauth:2.0:oob
  • Now open the link in a browser. You will see another code, save it too. We will call it code.
  • Now paste the following in browsers console,
copy(`curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${encodeURIComponent(prompt('Enter your clientId'))}&client_secret=${encodeURIComponent(prompt('Enter your clientSecret'))}&code=${encodeURIComponent(prompt('Enter your authcode'))}&grant_type=authorization_code&redirect_uri=urn:ietf:wg:oauth:2.0:oob"`);alert('The curl has been copied. Paste it into your terminal.')

and enter the three codes.

  • You'll get another code for curl.
  • Paste that on terminal to get access token and refresh token.

Now we have three codes.

clientId: 'xxxxxxxxxx'
clientSecret: 'xxxxxxxxxx'
refreshToken: 'xxxxxxxxxx'

We can use them to login to store and publish stuff automatically.

Step 3

  • To upload an extension automatically, we need to save the extension id.
  • If this is the chrome url, https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh then we have to save the gbmdgpbipfallnflgajpaliibnhdgobh part from it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment