Improve page specificity

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-10-20 17:15:45 -07:00
parent 0ff4155168
commit 6b84b38f2a

View File

@@ -16,7 +16,8 @@ class GlModelViewer extends ImageHandler {
} }
public static function onBeforePageDisplay(OutputPage $out) { public static function onBeforePageDisplay(OutputPage $out) {
if (strpos($out->getHTML(), 'class="glmv-viewer') !== false) { preg_match('/(<a href="\S*?\.(glb|gltf"))/',$out->getHTML(),$findGltf);
if ($findGltf[0]) {
$out->addModules('ext.glmv'); $out->addModules('ext.glmv');
} }
} }