Help with conversion of Asana links? #235
Replies: 4 comments 2 replies
-
|
The rewrite part is fairly straightforward, though attempts to route Asana links directly to the desktop app don't load the content of the link. This will open in the default browser, which then can pop open the Asana desktop app. Ideally we can discern the URL format the app needs to jump straight to content and use that in Finicky rather than this intermediate URL + browser step. |
Beta Was this translation helpful? Give feedback.
-
|
I had success with Asana by rewriting the module.exports = {
defaultBrowser: "Safari",
handlers: [{
match: "https://app.asana.com/*",
browser: "com.electron.asana",
url: ({url}) => {
return ({
...url,
protocol: "asanadesktop",
host: "/app"
});
}
}]
} |
Beta Was this translation helpful? Give feedback.
-
|
Thank you @maciejb ! I used your example and modified it a little bit because I had some issues.
So! In case it helps anyone final code is: |
Beta Was this translation helpful? Give feedback.
-
|
In Finicky v4 URL rewriting happens in the rewrite section, not in handlers. HTH anyone opening Asana links with the current version. export default {
defaultBrowser: "Google Chrome",
rewrite: [
{
// Handle Slack's Asana redirect URLs (app.asana.com/app/asana/-/log?...)
match: /app\.asana\.com\/app\/asana\/-\/log/,
url: (url) => {
const urlString = url.href;
const taskMatch = urlString.match(/task%2F(\d+)/);
if (taskMatch) {
return new URL(`asanadesktop:///app/0/0/${taskMatch[1]}`);
}
return url;
},
},
{
// Direct Asana links (/0/... or /1/...)
match: /app\.asana\.com\/[01]\//,
url: (url) => {
const urlString = url.href;
const matches = urlString.match(/\/(\d{10,})/g);
if (matches) {
const taskId = matches[matches.length - 1].replace('/', '');
return new URL(`asanadesktop:///app/0/0/${taskId}`);
}
return url;
},
},
],
handlers: [
{
match: /^asanadesktop:/,
browser: 'Asana',
},
]
} |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hey folks, any idea how I can alter Asana URLs so they trigger the right pages in the Asana desktop app?
e.g. if you click on a link like: https://app.asana.com/0/1116731155503379/1201546786800222/f
it opens a browser where it gets converted to: https://app.asana.com/-/desktop_app_link?path=%2F0%2F1116731155503379%2F1201546786800222%2Ff%3F
I'm sure this is an easy regex match + URL encode, but it's beyond my skill level :-(
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions