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.

我正在尝试创建一个能够更改网站可视化(.css或/和.js)的网页,以便重新创建Firebug for Firefox或Chrome Inspector所使用的相同实时更改功能。

Here an image to better explain my task:

这里有一张图片来更好地解释我的任务:

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?

有没有办法使用iframe或在另一个元素内加载外部网站?


Update:

Considering the answers the options should be:

考虑到答案,选项应该是:

  • create a php proxy page to load the target site and change visualization on it.
  • 创建一个php代理页面来加载目标站点并在其上更改可视化。

  • create a browser extention.
  • 创建浏览器扩展。

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.

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


Update 2:

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?

通过javascript加载整个页面可能是更好的解决方案(我不知道如何)如果可以实时更改代码,但是如何与这个“页面副本”交互并将交互转移到原始的?

Scheme:


Explanation:

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.

我注意到Firebug扩展可以选择并实时编辑任何页面元素,即使它们属于加载外部域页面的iframe。我正在寻找的是一种像Firebug一样的方式,获得一个元素并改变它的风格。我正在尝试将网站加载到iframe中,因为我想在它上面创建一个工具栏来选择我的“可视化样式”;例如,一个按钮,使标题更大和更红。无论如何,我对任何其他方法建议持开放态度。


Update 3:

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.

我发现FireFox和Chrome的扩展非常接近我的目标:“时尚”这个添加允许更改任何网站css proprerty并保存它以便每次访问页面时重新加载它们。

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

现在我的问题是:我如何创建一个专用页面来加载和更改特定站点的可视化?


FINAL EDIT:

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

为了用更相关的参数继续这个问题,我决定问一个新问题:创建一个php代理页面

3 个解决方案

#1


2

No. Your solutions may be

不,您的解决方案可能是

  • to let your own site act as proxy so the same origin policy isn't triggered
  • 让您自己的网站充当代理,因此不会触发相同的原始政策

  • to build an extension, which will be browser dependent (Firefox or Chrome) and which will require authorization and installation
  • 构建一个扩展,它将取决于浏览器(Firefox或Chrome),并且需要授权和安装

更多相关文章

  1. js点击button按钮跳转到另一个新页面
  2. Emberjs应用程序加载除Index之外的所有路由
  3. javascript阻塞加载问题【转】
  4. 当页面上有多个按钮时,按钮样式在页面加载上有厚的边框
  5. 调用另一个html页面后,选择列表值不会保持不变
  6. JavaScript实际应用:父子页面交互
  7. 如何从Vue.js中的变量名加载组件?
  8. iOS uiwebview无法从javascript方法加载资源
  9. 执行javascript作为coldfusion页面加载

随机推荐

  1. AndroidX迁移——弃用support库指南
  2. android 图片设置圆角
  3. Android之fragment的两种创建方式
  4. 【黑马Android】(02)短信发送器/布局演示
  5. Android原生应用的CTS测试步骤
  6. Android RecyclerView添加分隔线 Divider
  7. Android SDK Android NDK 官方下载地址
  8. Android Timer编写方式
  9. Android ListView中带有时间数据的排序
  10. 基础入门一