[07:48:48] I just had an idea, and I'm jotting it down here to see if maybe someone thinks it's doable or not. [07:48:49] [07:48:51] Introduce a new magic word called `{{#trigger:`_xyz_`}}` or something. This could interface with the gadgets to let gadgets run only when a trigger is present on the page (by adding `|trigger=xyz` to MediaWiki:Gadgets-definition). [07:48:52] [07:48:54] Is this workable? Should I file a Phab task about it (if so, what project? Gadgets?)? [07:48:55] [07:48:57] The reason I got this idea is because we have some code in MediaWiki:Common.js on no.wikipedia that is needed only on a few hundred pages, so loading it for every single page view is a waste of resources [07:57:00] the code should be cached though, so it shouldn't get downloaded repeatedly, and whether you do it server-side or in the gadget, something will need to check whether it should run on the current page [07:57:52] what does the code you're referring to do anyway? maybe someone can think of a better way to do it [08:14:01] one deals with those railway diagram maps (example (https://no.wikipedia.org/wiki/Gardermobanen#Linjekart)), the other with multiple images in infoboxes (example (https://no.wikipedia.org/wiki/Fylkesvei_7596)). i have an idea for how to replace the latter with `` and some templatetyles though (re @Nikki: what does the code you're referring to do anyway? [08:14:01] maybe someone can think of a better way to do it) [13:53:53] 👍 [14:22:20] As a gadget developer, I strongly support this idea. (re @jhsoby: I just had an idea, and I'm jotting it down here to see if maybe someone thinks it's doable or not. [14:22:21] [14:22:22] Introduce a new magic word ...) [22:21:18] Template Styles is kind of like that, but for CSS in template. You have a tag `` and that brings in sanitized CSS. This is a model for JavaScript snippets, though I think JavaScript snippets would be harder to sanitize. Come to think of it, this is kind of what Wikifunctions is. [23:30:56] @harej: wikifunctions are server-side which is pretty different than a gadget or common.js. Shipping "safe" javascript to a browser is still a holy grail feature. [23:37:09] yeah, it's kinda similar. my idea wouldn't really change the workflow for who can write gadgets and stuff though, so security-wise it wouldn't be any different from the status quo. [23:37:09] [23:37:11] Basically, I just want one more way to filter (?) when a gadget is loaded. You can currently do that by skin, action and user group, so this would add one more parameter there (re @harej: Template Styles is kind of like that, but for CSS in template. You have a tag and that brings in s...) [23:54:26] Why is Krinkle not in this channel? :/ @jhobsy, I'd suggest poking Krinkle (Timo) about the idea. If there's a reason that it would be really hard or not the savings you are hoping for he would likely know. [23:56:42] For what it's worth, I am not sure the JavaScript loading on every page is that big a deal. It's cached so it's not literally every page load, and presumably the code is only triggered in particular circumstances so it should take a negligible amount of time to run and exit and not do anything on those pages where the code is not applicable. This is to say I don't think it's urge [23:56:44] nt but it would definitely be an improvement.