Prevent selection being greyed out in iframe in Firefox without using contenteditable

前端 未结 3 1683
天涯浪人
天涯浪人 2021-02-19 10:45

In Firefox 3 and later (and probably older versions), selecting content within an iframe always seems to use the grey selection background colour used for a document that doesn\

3条回答
  •  余生分开走
    2021-02-19 11:18

    There is a property of the iframe exposed in Firebug's DOM inspector contentDocument->designMode which is set to false for you iFrames. Forcing it to true through the DOM inspector enables the blue highlight you're after.

提交回复
热议问题