加载外部网站,并改变它的可视化它的、加载、网站

2023-09-10 20:58:29 作者:怪我太天真

我想创建一个网页能够改变一个站点的可视化(的CSS和/或.js文件),以重建为Firefox或Chrome的检查相同的生活变化的能力offred由萤火虫。

I'm trying to create a web page able to change a site visualization (.css or / and .js) in order to recreate the same live change capability offred by Firebug for Firefox or the Inspector of Chrome.

下面的图像,以更好地解释我的任务:

Here an image to better explain my task:

我已经能够想象在我的页面上使用的iframe其他网站,但不幸的是它无法改变其可视化和访问它的元素因的同源策略。

I have been able to visualize the other site inside my page using the iframe, but unfortunately it is not possible to change its visualization and access its elements due to the "same origin policy".

有没有办法使用iframe或加载外部站点的另一个元素内做到这一点?

Is there a way to do this using the iframe or loading the external site inside another element?

更新:

考虑答案的选项应该是:

Considering the answers the options should be:

创建一个PHP代理页面加载目标站点,并更改可视化就可以了。 创建一个浏览器延伸。

我已经试过了第一,即使它需要安装一个Web服务器(XAMPP),用一个简单的页面调用函数的file_get_contents('http://www.site.com) ; 在页面加载,但遗憾的是错过了一些元素(如图像),它只是一个静态的副本; 是不可能的网址导航走得更远。

I've tried the first, even if it requires to install a web server (xampp), with a simple page calling the function file_get_contents('http://www.site.com'); The page is loaded but unfortunately missed some elements (like images) and it is only a static copy; it is not possible to go further in the site navigation.

更新2:

加载整个页面通过JavaScript可能是更好的解决方案(我却不知道怎么做),如果有可能的生活改变code,但怎么样用这个页复印互动和转移的可能性互动原来的那个?

Load the entire page via javascript could be the better solution (I don't konw how) if it is possible to live change the code but what about the possibility to interact with this "page copy" and transfer the interaction to the original one?

方案:

说明:

我注意到萤火虫延伸可以选择和实时编辑任何页面元素,即使他们属于哪个加载外部域页的iframe。 我正在寻找一种方法来像萤火虫,让一个元素并改变它的风格。 我试图加载网站进入的iframe怎么一回事,因为我想创建一个工具栏上方选择我的可视化风格;例如一个按钮以使标题更大和红色。 无论如何,我愿意接受任何其他方法的建议。

I've noticed Firebug extention can select and live edit any page element, even if they belong to the iframe which loads an external domain page. What I'm looking for is a way to act like Firebug, get an element and change its style. I'm trying to load the site into the iframe beacuse I wanted to create a toolbar above it to select my "visualization styles"; for example a button to makes titles bigger and red. Anyway I'm open to any other methods suggestions.

更新3:

我发现了一个延伸的Firefox和Chrome浏览器是非常接近我的目标是:时尚 这加上允许住改任何网站的CSS亲preRTY并保存,以便每次你访问该页面时重新加载它们。

I have found an extention for both FireFox and Chrome which is really close to my aim: "Stylish" This add on allows to live change any site css proprerty and save it in order to reload them every time you'll visit the page.

现在我的问题是:我怎么可以做同样的创建一个专门的页面加载和更改特定网站的可视化

Now my question is: How can I do the same creating a dedicated page to load and change visualization of a specific site?

最后编辑:

为了继续这个问题有更多的相关争论,我决定要问一个新的:的创建一个PHP代理页面

In order to continue this question with a more relevant arguments I decided to ask a new one: create a php proxy page

推荐答案

没有。您的解决方案可能是

No. Your solutions may be

来让自己的网站担任代理,以便同源策略,则不会触发 要建立一个扩展,这将是依赖于浏览器(Firefox或Chrome),并且将需要授权和安装