Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(manifest): Update the extensions manifests to adhere to the rebranding URLs #1850

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Site settings
title: "Toggl Button Chrome extension"
#email:
url: http://toggl.com
url: http://track.toggl.com
description: "Adds Toggl one-click time tracking to popular web tools."

# Color settings (hex-codes without the leading hash-tag)
Expand Down
5 changes: 2 additions & 3 deletions src/chrome-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"open_in_tab": true
},
"permissions": [
"*://*.toggl.com/*",
"*://toggl.com/*",
"*://track.toggl.com/*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't finish the login flow, I believe we still need access to toggl.com sans prefix

Look at these lines
https://github.com/toggl/toggl-button/blob/ce3fc5d34f317e3564ecbd82783bed2296498bab/webpack.config.js#L76
https://github.com/toggl/toggl-button/blob/16155d8560dfa2d9d6b1e550e6cc87fbebf989e8/src/scripts/components/LoginPage.tsx#L198

The extension needs access to toggl.com/track/toggl-button-login/ to communicate with it and be informed when the login completes
https://github.com/toggl/toggl-button/blob/1f335016dc614a5289eac5b471bd9fbc8c93de2f/src/scripts/content/toggl.js#L37-L48

But this content script won't work unless it has access to the public-web page

"webRequest",
"webRequestBlocking",
"alarms",
Expand All @@ -50,7 +49,7 @@
],
"optional_permissions": ["*://*/"],
"externally_connectable": {
"matches": ["*://*.toggl.com/*", "*://toggl.com/*"]
"matches": ["*://track.toggl.com/*"]
},
"content_security_policy":
"script-src 'self'; object-src 'self';",
Expand Down
3 changes: 1 addition & 2 deletions src/firefox-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"open_in_tab": true
},
"permissions": [
"*://*.toggl.com/*",
"*://toggl.com/*",
"*://track.toggl.com/*",
"webRequest",
"webRequestBlocking",
"alarms",
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ window.TogglButton = {
TogglButton.createTimeEntry(timeEntry, null);
buttonName = 'continue';
} else {
browser.tabs.create({ url: 'https://toggl.com/app/' });
browser.tabs.create({ url: 'https://track.toggl.com/' });
buttonName = 'go_to_web';
}
}
Expand Down Expand Up @@ -2342,7 +2342,7 @@ browser.webRequest.onBeforeSendHeaders.addListener(
return { requestHeaders: headers };
},
{
urls: ['https://www.toggl.com/*', 'https://toggl.com/*'],
urls: ['https://track.toggl.com/*'],
types: ['xmlhttprequest']
},
['blocking', 'requestHeaders']
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/QuickStartGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function QuickStartGuide () {
<p>The Toggl Button popup shows a list of your recent time entries*. You can edit them from here.</p>
<p>You can also enable useful time tracking features like idle detection and reminders from the Settings page.</p>
<Link href="settings.html"><Button>Settings <Arrow/></Button></Link>
<p className="small">*To see older time entries or run more complex reports, check out our web app at <Link href="https://toggl.com/app" target="_blank">toggl.com</Link>!</p>
<p className="small">*To see older time entries or run more complex reports, check out our web app at <Link href="https://track.toggl.com" target="_blank">toggl.com</Link>!</p>
</div>
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/TimeEntriesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const getTimeEntryDayGroups = (timeEntries: Array<Array<Toggl.TimeEntry>>): {[da

const TimeEntriesFooter = () => (
<Footer>
<a target="_blank" href="https://toggl.com/app/timer?utm_source=toggl-button&utm_medium=referral">
<a target="_blank" href="https://track.toggl.com/timer?utm_source=toggl-button&utm_medium=referral">
<MoreButton>
See more on <strong>toggl.com</strong>
</MoreButton>
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default class Db {
}

async getOriginFileName (domain) {
if (process.env.DEBUG && domain.endsWith('toggl.space')) {
domain = 'toggl.com';
if (process.env.DEBUG && domain.endsWith('track.toggl.space')) {
domain = 'track.toggl.com';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remain toggl.com or preferably we change the origins.js file to match the domain.
Currently it's set to toggl.com instead of track.toggl.com

image

}
let origin = await this.getOrigin(domain);
const origins = await this.getAllOrigins();
Expand Down
7 changes: 1 addition & 6 deletions src/scripts/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,7 @@ export default {
name: 'Todoist'
},
'toggl.com': {
url: '*://toggl.com/*',
name: 'Toggl',
clone: 'true'
},
'www.toggl.com': {
url: '*://www.toggl.com/*',
url: '*://track.toggl.com/*',
name: 'Toggl',
clone: 'true'
},
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ document.querySelector('#close-review-prompt').addEventListener('click', dismiss
});

const isNotTogglApp = (url) => {
return (url || '').match(/toggl\./) === null;
return (url || '').match(/track.toggl\./) === null;
};

const Settings = {
Expand Down