mohmmad_qunibi congrats on your first extension!
I haven't tested it, but looking at the source code, I don't think the javascript will work. app.forum.attribute('defaultRoute')
returns a path, not a route name. app.route()
is to generate a path from a route name. Passing the default route path as a route name will most likely fail, except if the Tags page is set as homepage since its path and name are identical. I think you can just pass a path unaltered to m.route.set()
. But actually even that is useless, because defaultRoute
is the setting for which path will be internally mapped to /
. So you can just call m.route.set('/')
.
Another client-side solution would be to just unregister the profile pages from the router, which would cause them to show 404.
Can you still access the preferences and security pages with this extension enabled? From the source code it looks like those would also be redirected since they extend UserPage
.