Skip to content

Commit

Permalink
extracting id on runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
QasimWani committed Nov 23, 2020
1 parent 1978311 commit b177403
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name" : "LeetHub",
"description" : "Automatically integrate your code with LeetCode and GitHub",
"homepage_url": "https://github.com/QasimWani/LeetHub",
"version" : "0.0.2",
"version" : "0.0.3",
"author" : "Qasim Wani",
"browser_action": {
"default_icon": "assets/thumbnail.png",
Expand Down
4 changes: 2 additions & 2 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1 id="title">Leet<span style="color: #f18500;">Hub</span></h1>
<br>
Set up repository hook to use <strong>Leet<span style="color: #f18500;">Hub</span></strong>
</p>
<a href="chrome-extension://aciombdipochlnkbpcbgdpjffcfdbggi/welcome.html" target="blank" class="ui secondary button">
<a id="hook_URL" href="" target="blank" class="ui secondary button">
<i class="icon github"></i>
Set up Hook
</a>
Expand All @@ -58,7 +58,7 @@ <h1 id="title">Leet<span style="color: #f18500;">Hub</span></h1>
<a href="https://github.com/QasimWani/LeetHub" target="_blank"><i class="ui black github icon"></i></a>
<a href="https://www.linkedin.com/in/qasimwani" target="_blank"><i class="ui linkedin icon"></i></a>
<a href="mailto:qasim31wani@gmail.com" target="_blank"><i class="ui red envelope icon"></i></a>
<a href="chrome-extension://aciombdipochlnkbpcbgdpjffcfdbggi/welcome.html" target="_blank"><i class="ui grey globe icon"></i></a>
<a id="welcome_URL" href="" target="_blank"><i class="ui grey globe icon"></i></a>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ $("#authenticate").on('click', ()=>{
}
});

/* Get URL for welcome page */
$("#welcome_URL").attr("href", `chrome-extension://${chrome.runtime.id}/welcome.html`);
$("#hook_URL").attr("href", `chrome-extension://${chrome.runtime.id}/welcome.html`);

chrome.storage.sync.get("leethub_token", (data)=>{
const token = data.leethub_token;
if(token == null || token == undefined)
Expand Down
2 changes: 1 addition & 1 deletion scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function handleMessage(request, sender, sendResponse) {
});

/* Go to onboarding for UX */
let url_onboarding = "chrome-extension://aciombdipochlnkbpcbgdpjffcfdbggi/welcome.html";
let url_onboarding = `chrome-extension://${chrome.runtime.id}/welcome.html`;
chrome.tabs.create({url: url_onboarding, selected: true}); //creates new tab
}
else if(request && request.closeWebPage == true && request.isSuccess == true)
Expand Down

0 comments on commit b177403

Please sign in to comment.