Disabling browser status bar text

前端 未结 5 1029
执笔经年
执笔经年 2021-02-13 17:50

Background

Modern browsers do away with the classic status bar and instead draw a small tooltip at the bottom of their windows that displays the link target on hover/f

5条回答
  •  野性不改
    2021-02-13 17:58

    Is there a portable way to disable these tooltips?

    Nope, other than workarounds like your example above.

    Am I missing any obvious drawbacks to doing this in my particular situation?

    You seem to be missing the fact that the whole situation is awkward. Why have links at all if you're going to make them look like buttons? Just use buttons. For that matter, why bother with links if you end up switching them out with spans anyway? Just use spans.

    Is my attempt (see below) a reasonable way of accomplishing this?

    It's not really reasonable as a general approach, because you're removing those anchor elements from the document, so any attached event listeners, expandos, etc. will be lost. It may work for your specific situation, but a more sane approach would be to not use links in the first place (see above).


    If you're still determined to do something like this, at least don't replace the a element. Just get rid of its href attribute and set up an event listener as you did in your example. Now it's no longer a link, so it won't show up in the status bar (but it's still the same element, at least).

提交回复
热议问题