Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

<script> & <link> tags are ignored (possible solution included)

未关闭
#116 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript
领域
frontend, web-dev

调研方向

使用链接的 RequireBin gist 重现该行为,并检查 iframe/index.js 中所引用的 source 赋值附近的代码,以及 browser-module-sandbox 依赖项。将 Blob URL 方案与 Chrome DevTools 的 Network 标签页中报告的 srcdoc 行为进行比较。当 HTML head 中的 link 和 script 标签按预期处理时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Working with this gist: http://requirebin.com/?gist=01274d1e3cd82fa3d12cdb6466f42106

First off, this is an awesome tool! Thank you for giving me such a great head start on my own project.

I was fooling around locally with the project, specifically the <head> area of the app and attempted to place a <link> and a <script> tag in it. I was expecting the <link> tag (pointing to a Google Font) to work, and expecting the <script> tag to fail since there is no "some-library.js" on requirebin's servers.

Instead, I saw no attempt to download those assets from within Chrome (51) DevTool's Network tab. It was like the tags were being ignored completely.

After some searching, I found that I was able to get it to work by adjusting iframe's source code (project is depended on from requirebin and browser-module-sandbox), changing:

tempIframe.src = targetUrl
to
tempIframe.srcdoc = opts.html

It seems that Chrome didn't like the created Blob URL. Using srcdoc instead seemed to work. I doubt this is a very clever solution, and welcome any comments to this issue.

Mind you, I intend to fork this project to suit my own needs, so I'm not sure if this is even an appropriate issue to report. But I figured I'd raise it in case anyone else experienced similar issues.

Thanks!
Tim

主要语言
JavaScript
星标
389
派生
73
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

max-mapper/requirebin 的其他 Issue

查看 max-mapper/requirebin 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。