!AXdLfOGmSqOJipwjRW:matrix.org

tridactyl

264 Members
https://github.com/tridactyl/tridactyl archived messages: https://matrix.to/#/!xmubtggllUtLrQiGyn:matrix.org/$1654280187215fKpBY:matrix.org?via=matrix.org&via=t2bot.io&via=kde.org47 Servers

Load older messages


SenderMessageTime
28 Jul 2024
@monirzadeh:matrix.orgmonirzadeh

Hi
I try to redirect website with command like this
autocmd BeforeRequest https://www.reddit.com/* () => ({redirectUrl: "https://reddit.rtrace.io"})
But it is replace whole URL
For example instead of redirect
https://www.reddit.com/r/degoogle/
To
https://reddit.rtrace.io/r/degoogle/

It is redirect
https://www.reddit.com/r/degoogle/
To
https://reddit.rtrace.io

15:04:30
@monirzadeh:matrix.orgmonirzadehDo I something wrong?15:07:52
@jacksonchen666:jacksonchen666.comjacksonchen666 (they/it) monirzadeh: i'd suggest using something like libredirect instead 15:29:48
@monirzadeh:matrix.orgmonirzadeh
In reply to @jacksonchen666:jacksonchen666.com
monirzadeh: i'd suggest using something like libredirect instead
Thanks but i try to replace that with tridactyl if it possible (to decrease number of extension on my browser)
16:02:35
@bovine3dom:matrix.orgbovine3dom
In reply to @monirzadeh:matrix.org

Hi
I try to redirect website with command like this
autocmd BeforeRequest https://www.reddit.com/* () => ({redirectUrl: "https://reddit.rtrace.io"})
But it is replace whole URL
For example instead of redirect
https://www.reddit.com/r/degoogle/
To
https://reddit.rtrace.io/r/degoogle/

It is redirect
https://www.reddit.com/r/degoogle/
To
https://reddit.rtrace.io

it should be more like details => rather than () => and somewhere in that details object there'll be the old URL that you need to transform into the new URL
22:18:27
@bovine3dom:matrix.orgbovine3domI think the autocmd help explains it I can't be much more help right now as I'm travelling22:18:49
29 Jul 2024
@monirzadeh:matrix.orgmonirzadeh
In reply to @bovine3dom:matrix.org
it should be more like details => rather than () => and somewhere in that details object there'll be the old URL that you need to transform into the new URL
I test different things but not work yet
Set debug not give me acsses to variable details
09:47:50
@monirzadeh:matrix.orgmonirzadehI can see just after get redirect request09:48:47
@haugh:matrix.orghaugh @monirzadeh https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest#details_2 20:01:35
30 Jul 2024
@twoneis:arcticfoxes.nettwoneis joined the room.14:51:27
@beslayed-:matrix.orgemacsomancer changed their profile picture.16:33:22
@beslayed-:matrix.orgemacsomancer changed their profile picture.16:35:38
31 Jul 2024
@monirzadeh:matrix.orgmonirzadeh
In reply to @haugh:matrix.org
@monirzadeh https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest#details_2

Thanks
I done that with something like this

 jsb browser.webRequest.onBeforeRequest.addListener( \
     details => { \
         let url = new URL(details.url);\
         url.hostname = "piped.lunar.icu"; \
         return { redirectUrl: url + "" }; \
     }, \
     {urls:["https://www.youtube.com/*","https://youtube.com/*"], types:["main_frame"]}, ["blocking"] \
 );

But it is not possible with autocmd yet :(

16:16:55
@bovine3dom:matrix.orgbovine3dom
In reply to @monirzadeh:matrix.org

Hi
I try to redirect website with command like this
autocmd BeforeRequest https://www.reddit.com/* () => ({redirectUrl: "https://reddit.rtrace.io"})
But it is replace whole URL
For example instead of redirect
https://www.reddit.com/r/degoogle/
To
https://reddit.rtrace.io/r/degoogle/

It is redirect
https://www.reddit.com/r/degoogle/
To
https://reddit.rtrace.io

you need to use this syntax
17:19:41
@bovine3dom:matrix.orgbovine3dom
In reply to @monirzadeh:matrix.org

Thanks
I done that with something like this

 jsb browser.webRequest.onBeforeRequest.addListener( \
     details => { \
         let url = new URL(details.url);\
         url.hostname = "piped.lunar.icu"; \
         return { redirectUrl: url + "" }; \
     }, \
     {urls:["https://www.youtube.com/*","https://youtube.com/*"], types:["main_frame"]}, ["blocking"] \
 );

But it is not possible with autocmd yet :(

just the middle bit of this
17:19:57
2 Aug 2024
@ccx:artemislena.euccx joined the room.00:35:38
@ccx:artemislena.euccx

I know the browser can use the native component to perform actions. But is it possible to go the other direction and query the browser from outside? e.g. to get a list of open windows/tabs

01:28:31
@ccx:artemislena.euccx

I also seem to have

01:56:11
@ccx:artemislena.euccx

I also seem to have Marionette working. However I'm not sure how I'd access tridactyl's functions from chrome context.

01:56:52
@bovine3dom:matrix.orgbovine3dom
In reply to @ccx:artemislena.eu

I know the browser can use the native component to perform actions. But is it possible to go the other direction and query the browser from outside? e.g. to get a list of open windows/tabs

no, there's an issue open for it https://github.com/tridactyl/tridactyl/issues/780 but it won't happen any time soon (ever?)
07:45:18
@bovine3dom:matrix.orgbovine3dom
In reply to @ccx:artemislena.eu

I also seem to have Marionette working. However I'm not sure how I'd access tridactyl's functions from chrome context.

If you can control the Firefox address bar, tri [ex command here] will run a tridactyl command
07:45:51
@monirzadeh:matrix.orgmonirzadeh
In reply to @bovine3dom:matrix.org
just the middle bit of this
autocmd BeforeRequest https://www.YouTube.com/* (details) => (let url = new URL(details.url); url.hostname = "piped.lunar.icu"; {redirectUrl: url + ""})

Which part of this is wrong? 🤔

10:37:21
@monirzadeh:matrix.orgmonirzadeh
In reply to @bovine3dom:matrix.org
just the middle bit of this
*
autocmd BeforeRequest https://www.youtube.com/* (details) => (let url = new URL(details.url); url.hostname = "piped.lunar.icu"; {redirectUrl: url + ""})

Which part of this is wrong? 🤔

11:30:57
@bovine3dom:matrix.orgbovine3domno return and you need to surround the function body in {} not ()13:15:55
@monirzadeh:matrix.orgmonirzadeh
In reply to @bovine3dom:matrix.org
no return and you need to surround the function body in {} not ()

I change that to

autocmd BeforeRequest https://www.youtube.com/* (details) => {let url = new URL(details.url); url.hostname = "piped.lunar.icu"; redirectUrl: url + "";}

Not working

14:40:09
@bovine3dom:matrix.orgbovine3domstill no return15:29:26
@bovine3dom:matrix.orgbovine3domAlso you've mangled the object that you need to return in the last line15:29:50
@bovine3dom:matrix.orgbovine3domsorry, I don't have much time at the moment, usually I would just write it for you :)15:30:18
@bovine3dom:matrix.orgbovine3domIt needs to look like `return {redirect.... }}`15:30:38
@monirzadeh:matrix.orgmonirzadeh
In reply to @bovine3dom:matrix.org
It needs to look like `return {redirect.... }}`

Thanks

It is work now

autocmd BeforeRequest https://www.youtube.com/* (details) => {let url = new URL(details.url); url.hostname = "piped.lunar.icu"; return {redirectUrl: url + ""}}

for anybody else that maybe need this

16:15:02

Show newer messages


Back to Room ListRoom Version: 6