Re: [qutebrowser] new protocols
A searchengine is essentially a string substitution. A userscript is a full-fledged executable with infinite possibilities. These infinite possibilities include infinite possible bugs and security risks :) If a searchengine works for your use case, keep it simple and stick with that. Userscripts are useful for advanced processing or integration with external tools, like a password manager. You might glance at some if the scripts included in qutebrowser if you're curious. -Ryan On January 22, 2019 9:46:33 PM EST, Luis Mochan wrote: >Another question, >I found out about the userscripts in qutebrowser. I guess they could >also be used, as well as the solution below, for translating from a >doi number to an access into the doi webpage and the actual article. >What would be the advantages/disadvantages of a userscript solution as >compared to the c.url.searchengines one? >Regards, >Luis > > >On Tue, Jan 22, 2019 at 03:54:26PM -0600, Luis Mochan wrote: >> Hi Patric, >> >> On Tue, Jan 22, 2019 at 01:07:47PM +0100, Patric Schmitz via >qutebrowser wrote: >> > ... >> > could it be sufficient to define a search engine for this? So >create an >> > entry in c.url.searchengines in your config.py like >> > >> > 'doi': 'https://doi.org/{}', >> > >> > which will allow you to just write >> > >> > doi ... >> > >> > in the address line? It won't be possible to click URL links of the >form you >> > mentioned, but maybe that's enough for your usecase? >> >> Yes, indeed. Thanks! >> >> Regards, >> Luis >> >> -- >> >> o >> W. Luis Mochán, | tel:(52)(777)329-1734 >/<(*) >> Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ > /\ >> Apdo. Postal 48-3, 62251 | >(*)/\/ \ >> Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ >> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB >> >> > >-- > > o >W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) >Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ >/\ >Apdo. Postal 48-3, 62251 | (*)/\/ > \ >Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ >GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Re: [qutebrowser] new protocols
Another question, I found out about the userscripts in qutebrowser. I guess they could also be used, as well as the solution below, for translating from a doi number to an access into the doi webpage and the actual article. What would be the advantages/disadvantages of a userscript solution as compared to the c.url.searchengines one? Regards, Luis On Tue, Jan 22, 2019 at 03:54:26PM -0600, Luis Mochan wrote: > Hi Patric, > > On Tue, Jan 22, 2019 at 01:07:47PM +0100, Patric Schmitz via qutebrowser > wrote: > > ... > > could it be sufficient to define a search engine for this? So create an > > entry in c.url.searchengines in your config.py like > > > > 'doi': 'https://doi.org/{}', > > > > which will allow you to just write > > > > doi ... > > > > in the address line? It won't be possible to click URL links of the form you > > mentioned, but maybe that's enough for your usecase? > > Yes, indeed. Thanks! > > Regards, > Luis > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Apdo. Postal 48-3, 62251 | (*)/\/ \ > Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB > > -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB
Re: [qutebrowser] new protocols
Hi Patric, On Tue, Jan 22, 2019 at 01:07:47PM +0100, Patric Schmitz via qutebrowser wrote: > ... > could it be sufficient to define a search engine for this? So create an > entry in c.url.searchengines in your config.py like > > 'doi': 'https://doi.org/{}', > > which will allow you to just write > > doi ... > > in the address line? It won't be possible to click URL links of the form you > mentioned, but maybe that's enough for your usecase? Yes, indeed. Thanks! Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB
Re: [qutebrowser] new protocols
Hi, could it be sufficient to define a search engine for this? So create an entry in c.url.searchengines in your config.py like 'doi': 'https://doi.org/{}', which will allow you to just write doi ... in the address line? It won't be possible to click URL links of the form you mentioned, but maybe that's enough for your usecase? Best, Patric On 1/22/19 2:09 AM, Luis Mochan wrote: Which is the recommended way to add new protocols to qutebrowser. I would like, for example, to open https://doi.org/.../... when I try to open an academic article, given its digital object identifier in the form doi:.../... I would like the protocol (doi) to be recognized and the simple translation (substitution of doi: by https:://doi.org/) to be done automatically. I did this in conkeror through its set_protocol_handler function. Best regards, Luis
[qutebrowser] new protocols
Which is the recommended way to add new protocols to qutebrowser. I would like, for example, to open https://doi.org/.../... when I try to open an academic article, given its digital object identifier in the form doi:.../... I would like the protocol (doi) to be recognized and the simple translation (substitution of doi: by https:://doi.org/) to be done automatically. I did this in conkeror through its set_protocol_handler function. Best regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB