#Custom protocol

73 messages · Page 1 of 1 (latest)

round sinew
#

I need to register a protocol with these args: nxm://{Game}/mods/{ModId}/files/{FileId}?{QueryString} How do i register it and make it send the data to the frontend when opened??

#

Custom protocol

queen hinge
#

i don't know what framework are you using, but what tauri does is just display a website as an application (and add rust code to it).

every web related thing that you want to do should stay the same as you would in a normal website

round sinew
#

Sveltekit

queen hinge
round sinew
#

A custom protocol

#

protocol

queen hinge
#

so just check the protocol and return if it's the wrong protocol?

round sinew
#

What do you mean

#

can you please read the question

queen hinge
#

i don't think you understand how protocols quite work work

#

you don't "make" custom protocols

#

or register it

#

you can just look at it through window.location.protocol

round sinew
#

No

queen hinge
#

unless i am misunderstanding you?

round sinew
#

You register them

#

With the registry

#

I need to register the nxm:// custom protocol

#

A protocol used by nexusmods

queen hinge
#

ohhhh, now i think i understand what did you mean

#

i thought you meant creating the route for that url

#

i was the one who misunderstood you

round sinew
#

I think i have to do rust thing

#

But i dont know rust

#

😭

queen hinge
#

i might not know how to register a protocol (i never thought about doing that sort of thing in tauri, that's for sure). but i can at least tell you that you probably don't need to do any rust

#

tauri just embeds rust into the final app, but it's just normal rust

round sinew
#

U need to edit the registry

#

or something

queen hinge
#

then you probably just need to change the tauri.conf.json

round sinew
queen hinge
round sinew
#

Can you link the doc that explains this?

queen hinge
#

it's extremly long, so good luck

round sinew
#

Already read it, no mention to making a custom protocol

queen hinge
#

found it, there is an option to make and allow custom protocols

round sinew
#

Allow

#

Not register

#

Can you screenshot?

queen hinge
queen hinge
#

slightly bad news, i tried to find how to register it specifically. and i found this in the docs

#

it's not to register protocols

#

but you can probably use this to register them as well

round sinew
#

Yeah, i just dont know how

queen hinge
#

what system do you want to make the app for?

#

you probably need to pick one and follow its API

round sinew
#

No, i have to work with NexusMods that works like this, it sucks, i know.

queen hinge
#

so what do you plan on doing? according to tauri the way they register the protocol is different on every OS

#

they just use a command from every API

round sinew
#

The app is windows only

queen hinge
round sinew
#

Cuz i dont give a shit about mac and linux

queen hinge
round sinew
#

Linux users can just emulate that with their 50k pc and mac users can just afford to buy windows (the app is videogames related so wtf are u playing games on mac)

queen hinge
#

now this is less of a tauri thing and more of a windows issue

#

i tried looking at the docs

#

and i found this

round sinew
#

Its a windows api reference

queen hinge
#

sadly you do need rust to register the protocol

queen hinge
round sinew
#

it wont lead to anything

queen hinge
#

you need to manually create the function to register it

round sinew
#

I already did registry stuff with the WinReg crate so we just have to make it able to create the protocol and give the data to the frontend

#

brb tomorrow sry i have stuff to do

queen hinge
#

no prob

nova dew
round sinew