# blockenberg/2.0.7/blocks/google-map/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.7. 34 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/google-map/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/google-map/frontend.js
- Modified: 2026-03-06T12:32:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/google-map/frontend.js#L10-L20`.

```javascript
(function () {
    'use strict';

    /**
     * Blockenberg Google Map — frontend script
     *
     * Minimal enhancement:
     * - Ensures every iframe has a title for accessibility (in case a theme strips it).
     * - Adds keyboard focusability to the iframe so keyboard users can interact.
     */
    function initMaps() {
        var maps = document.querySelectorAll('.bkbg-gm-wrap iframe');
        if (!maps.length) return;

        maps.forEach(function (iframe) {
            // Ensure title attribute exists (accessibility/screen-readers)
            if (!iframe.getAttribute('title')) {
                iframe.setAttribute('title', 'Google Map');
            }

            // Make iframe keyboard-focusable if it isn't already
            if (!iframe.hasAttribute('tabindex')) {
                iframe.setAttribute('tabindex', '0');
            }
        });
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', initMaps);
    } else {
        initMaps();
    }
})();

```
