Scrapboxにいろんなものを埋め込む
UserScriptで<iframe>を埋め込む
<iframe>でのうめこみが想定されているページしか埋め込めない
20210927 Chromeだと出来なくなっているみたい?blu3mo.icon
https://gyazo.com/26ce2405131d2dfad300782944efcfe6
Firefoxだと依然埋め込めるtakker.icon
https://gyazo.com/e82a14b13126e32b963f340a1afdb667
あー、frame-srcに引っかかるのかtakker.icon
code:txt
Refused to frame 'https://embed.nicovideo.jp/' because it violates the following Content Security Policy directive: "frame-src 'self' www.google.com www.youtube.com player.vimeo.com translation.helpfeel.com js.stripe.com".
ニコニコ動画を埋め込む
code:js
(() => {
const source = 'https://embed.nicovideo.jp/watch/sm9'
document.getElementById('editor').insertAdjacentHTML('beforeend',
`<div class="iframe-video-player">
<iframe style="display: inline-block;" src=${source}></iframe>
</div>`);
})();
https://gyazo.com/53e6a7b478727dd4023f601733e66903
大技やなー... 増井俊之.icon
Google Calendarを埋め込む
calendarIdはencodeしないとエラーになる
code:js
(() => {
const calendarIds = 'ja.japanese#holiday@group.v.calendar.google.com'
.map(id => encodeURIComponent(id));
const timezone = 'Asia/Tokyo';
const params = [...calendarIds.map(id => src=${id}), ctz=${timezone}].join('&');
document.getElementById('editor').insertAdjacentHTML('beforeend',
`<div class="iframe-video-player">
<iframe src="https://calendar.google.com/calendar/embed?${params}" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
</div>`);
})();
大きく表示したいときは<div>を外す
もっと大きくしたいときは<iframe>の大きさを変える
ScrapboxにEpisoPassを埋め込む
ScrapboxにScrapboxを埋め込む
昔、タイトルが特定の条件にマッチしたら同名のprivateプロジェクトをiframeで埋め込むUserscriptをつくったblu3mo.icon
UserScript.icon