Wikimedica / mediawiki-extensions-PWA

PWA extension for MediaWiki
GNU General Public License v3.0
2 stars 2 forks source link

Allow configuring URL to use article path #6

Open Universal-Omega opened 1 year ago

Universal-Omega commented 1 year ago

So you don't have to use /index.php, but the $wgArticlePath/MediaWiki:PWA-main-ServiceWorker.js?params method also. As it can't be redirected, I redirect /index.php URLs to the article path method, which results in an error that the service worker can not be redirected. Also the same thing for the manifest should be supported probably.

bitsofmymind commented 1 year ago

Service workers need a scope and that scope is defined by their URL (see the following link). For the purpose of this extension, we want a service worker to apply to the whole wiki regardless if the page is requested using $wgArticlePath or using index.php (which is often used when accessing edition, history, etc.)

This is why it is request using index.php, because index.php is always at at the root of the wiki.

Can you give me a sample of some URLs on your wiki ? For editing, for special pages, for history, etc.

Universal-Omega commented 1 year ago

Service workers need a scope and that scope is defined by their URL (see the following link). For the purpose of this extension, we want a service worker to apply to the whole wiki regardless if the page is requested using $wgArticlePath or using index.php (which is often used when accessing edition, history, etc.)

This is why it is request using index.php, because index.php is always at at the root of the wiki.

Can you give me a sample of some URLs on your wiki ? For editing, for special pages, for history, etc.

bitsofmymind commented 1 year ago

Would an option to generate the URLs using $wgArticlePath work ?

Universal-Omega commented 1 year ago

Would an option to generate the URLs using $wgArticlePath work ?

Yeah, that should work. Thanks!

bitsofmymind commented 1 year ago

Ok, I'll make a branch and let you know when it's ready for testing. Should not be too hard. If you are willing to fork and do a pull request that would be very helpful as well and would expedite things a great deal.