Giter Club home page Giter Club logo

Comments (1)

mika-cn avatar mika-cn commented on August 17, 2024 1

把存儲格式配置爲 Markdown 可以重現該問題。調試後發現問題的起因是,該網站的開發者在編寫代碼的時候,居然插入了一個隱形的字符(0xC2A0),搜索後發現該字符是 UTF-8 for non-breaking space,然後該字符後面是一個 HTML 屬性名 rel,導致整個屬性名實際是[隱形字符 0xC2A0] + rel

瀏覽器在解析這段 HTML 的時候,沒有剔除這個有非法字符的名字,在訪問 element.attributes 可以看到該屬性。然而在 Element.setAttribute(attrName, attrValue) 這個調用中,卻直接拋出錯誤。 MaoXian 使用到了 setAttribute 這個調用, 導致了問題 String contains an invalid character 的出現。

有趣的是:這個網站的開發者好像發現了這個本意爲 rel 的屬性沒有產生預期的效果,但是又找不出來哪裏出了問題。於是他又添加了一個 rel 屬性,然後神奇的事情發生了,這個新添加的屬性產生了預期的效果。然後他就交差了,也沒有把那個有問題的 rel 刪除。他爲啥不刪除第一個有問題的 rel ? 這肯定是個有意思的問題,哈哈。

另:都什麼年代了,這些官網爲啥還不上 https 。恐怕這背後有一些骯髒的往事,哈哈。


這個問題修了,也上線了,但是 Firefox 擴展中心,暫不上線,因爲那邊的帳號中心系統最近有問題。

from maoxian-web-clipper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.