/
githubmirror
/
markdown-here
Обзор
Документация
Войти
/
githubmirror
/
markdown-here
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/common/options-iframe.js
18 строк
606 B
Adam Pritchard
minimize initial permissions
10 июл 2025, 04:12
10 июл 2025, 04:12
9148c08
Код
Авторство
О чём код?
/* * Copyright Adam Pritchard 2015 * MIT License : https://adampritchard.mit-license.org/ */ function onLoad() { // The body of the iframe needs to have a (collapsed) selection range for // Markdown Here to work (simulating focus/cursor). const range = document.createRange(); range.setStart(document.body, 0); const sel = document.getSelection(); sel.removeAllRanges(); sel.addRange(range); const demoMarkdown = Utils.getMessage('options_page__preview_markdown'); Utils.saferSetInnerHTML(document.body, demoMarkdown); } document.addEventListener('DOMContentLoaded', onLoad, false);