javascript 创建 Internet Explorer 扩展更改网页的内容

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6097262/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 19:26:04  来源:igfitidea点击:

Create Internet Explorer extension changing content of a webpage

javascripthtmlinternet-explorer

提问by Bruno

I'd like to develop an Internet Explorer extension that changes the content of a specific webpage, like content scripts in Google Chrome. (eg. when I go to the website Google and I search for "car" I'd like to have a div created on the page with the word "car" inside).

我想开发一个 Internet Explorer 扩展程序来更改特定网页的内容,例如 Google Chrome 中的内容脚本。(例如,当我访问 Google 网站并搜索“汽车”时,我希望在页面上创建一个带有“汽车”字样的 div)。

I've been looking on SO but haven't found clear evidences if this kind of thing is possible.

我一直在寻找 SO 但还没有找到明确的证据,如果这种事情是可能的。

What I'm specifically looking for is a clear tutorial or some example of how to do this.

我特别在寻找的是一个清晰的教程或一些如何做到这一点的例子。

Bruno,

布鲁诺,

采纳答案by Miguel Angelo

I have answered a similar question, but the answer is in C#. It describes how to create a fully working project to accomplish exactly what you asked: changing page contents!

我已经回答了一个类似的问题,但答案是在 C# 中。它描述了如何创建一个完全有效的项目来完成您的要求:更改页面内容!

How to get started with developing Internet Explorer extensions?

如何开始开发 Internet Explorer 扩展?

It covers other topics too:

它也涵盖其他主题:

  • running javascripts from the addin
  • how to register IE addins
  • saving data (addin configurations)
  • 从插件运行 javascripts
  • 如何注册 IE 插件
  • 保存数据(插件配置)

回答by Jonathon

That is exactly what GreaseMonkey for IE is made for http://www.gm4ie.com/

这正是为http://www.gm4ie.com/制作的用于 IE 的 GreaseMonkey

回答by Mohamed Mansour

You can read more about Internet Explorer Extension from MSDN:

您可以从 MSDN 阅读有关 Internet Explorer 扩展的更多信息:

http://msdn.microsoft.com/en-us/library/aa753587(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/aa753587(v=vs.85).aspx

Extensions in IE are not created using web technologies, they are created using C++/.NET. Such as ActiveX

IE 中的扩展不是使用 Web 技术创建的,而是使用 C++/.NET 创建的。比如 ActiveX

回答by cwd

Similar to "GreaseMonkey for IE" is Trixie:

与“GreaseMonkey for IE”类似的是 Trixie:

Trixieis to Internet Explorer as Greasemonkey is to Firefox. It lets you remix the Web via scripts. You may do this to either make it more readable, fix bugs or to even add little features to make the site more usable to you. Trixie by itself does none of this. It is just a plugin for Internet Explorer that enables executing chunks of JavaScript code and thus lets you use the Web the way you want to use it.

Trixie 之于 Internet Explorer,就像 Greasemonkey 之于 Firefox。它允许您通过脚本重新混合 Web。您可以这样做以使其更具可读性、修复错误或什至添加一些小功能以使站点对您更有用。Trixie 本身不做这些。它只是 Internet Explorer 的一个插件,可以执行 JavaScript 代码块,从而让您以自己想要的方式使用 Web。

回答by Kamahire

This is one of the best I found. http://www.enhanceie.com/ie/dev.aspIt has give sample scripts as well. Which will help you.

这是我发现的最好的之一。http://www.enhanceie.com/ie/dev.asp它还提供了示例脚本。这会对你有帮助。

Another one is open source and stable version : firebreath

另一个是开源稳定版:firebreath

same kind question is also asked How to get started with developing Internet Explorer extensions?

同样的问题也被问到如何开始开发 Internet Explorer 扩展?

回答by Tyler Rafferty

This is a working example of manipulating the DOM from microsoft. This is a BHO development with MS Visual Studio. Check it out: http://msdn.microsoft.com/en-us/library/bb250489%28v=vs.85%29.aspx

这是一个操作来自微软的 DOM 的工作示例。这是使用 MS Visual Studio 进行的 BHO 开发。检查一下:http: //msdn.microsoft.com/en-us/library/bb250489%28v=vs.85%29.aspx