tl;dr: I reported a bug at 10.000ft but still want to understand what happens between Alfred and Safari, and what the best approach is to send complex URLs to the browser.
I understand that the URL should be correct, that's where I was looking for solutions in the first place. I can send you loads of URLs that are not working :-) but that does not seem relevant right now since I know that the problem is not occurring in my .py script. Something goes wrong between Alfred and the browser. Let me explain: I have an URL that works if i paste it in Safari. If I ask Alfred to open exactly the same URL it in Safari (my default browser), either with open through a script as suggested or with open url as an action it does not work as expected.
Q: Do you agree on this?
The result/behaviour that I don't expect is that the report is missing markup / CSS. I do not see this behaviour in Chrome btw. But maybe other things are going wrong under the hood, an uncertainty I don't like when i comes to project reports :-). I must admit that the 10.000ft application is a bit wonky, I just discovered that if I paste the URL a second time, I get the same unwanted behaviour, so I also filed a bug report about errors in this reports section. But it is still strange that if I paste the same URL everything is OK the first time, right?
Q: Is there a way to see what Alfred sends to the browser or what the browser receives from Alfred?
You are looking at the master, check out the development branch for the most recent code. It is still not perfect but I think I need to solve the Alfred > Safari (or the bug in the website) problem first before fixing this.
Trivial n00b Q: I thought encoding was the problem so I added .encoding(utf-8) on line 308 & 309. Is this necessary/correct?
Thanks for explaining, good to have a better understanding of how this works in Alfred. So if I understand correctly there are two approaches:
- build the full URL in the python script only put {query} in as a value for the Open URL action
- put the full URL in the Open URL value and add variables in it? What is this the best way to insert multiple variables?
Q: What is the best way to build/send complex URLs like these to the default browser through Alfred?