public function onScriptLoaderTag($tag, $handle): string
    {
        $tag    = (string) $tag;
        $handle = (string) $handle;

        if (!($script = $this->didEnqueueScript($handle))) {
            return $tag; // We did not enqueue.
        }
        if ($script['async'] && !preg_match('/\s(?:async|defer)[=\s>]/ui', $tag)) {
            $tag = str_replace(' src=', ' async src=', $tag);
        } elseif ($script['defer'] && !preg_match('/\s(?:async|defer)[=\s>]/ui', $tag)) {
            $tag = str_replace(' src=', ' defer src=', $tag);
        }
        if ($script['sri'] !== '' && !preg_match('/\sintegrity\s*\=/ui', $tag)) {
            if (($sri = $script['sri']) || ($sri = $this->c::sri($script['url']))) {
                $tag = str_replace(' src=', ' integrity="'.esc_attr($sri).'" crossorigin="anonymous" src=', $tag);
            } // NOTE: SRI may or may not be possible right now. Always check if `$sri` is non-empty.
            // NOTE: `c::sri()` also will not return an SRI for local resources on the current hostname.
        }
        return $tag; // Possibly modifed above.
    }