我们都知道Firebug / Web Developer Toolbar等可以将任何页面的HTML / CSS更改到我们本地机器上。然而,刷新后,我们知道这些更改并未保存。
人们如何以自动方式为我们的本地计算机保存这些更改,以便在刷新站点后重新出现我们的更改?
例如,假设我访问一个博客发布网站,该网站每天都会有人更新。假设我想将我读过的每个博客标题的背景颜色设置为明亮且令人讨厌的红色(因此将来快速查看可以让我跳过这些)。在这种情况下,假设标题始终是 h2 元素。我会向此标题添加一个内联元素,因此:
今年世界末日!
成为
今年世界末日了!
有没有办法在我们本地标记、突出显示或更改此博客文章标题未来有自动观看的机器吗?
We all know that Firebug / Web Developer Toolbar, etc. can change the HTML/CSS of any page to our local machines. Upon refreshing, however, we know these changes are not saved.
How does someone save these changes for just our local machine, in an automatic fashion that would have our changes reappear after refreshing the site?
For example, say I go to a blog posting website, which is updated by someone every day. Say I wanted to color the background of every blog's title I've read a bright annoying red, (so quick viewing in the future would allow me to skip over these). In this case, imagine the title is always an h2 element. I would add an inline element to this heading, so:
<h2>The world ends this year!</h2>
becomes
<h2 style="color:red;">The world ends this year!</h2>
Is there any way to Mark, Highlight, or change this blog post title on just our local machine for automatic viewing in the future?
发布评论
评论(3)
如果您的目标是个性化您自己的网络体验,我推荐Greasemonkey 脚本
以编程方式应用 CSS。有一个名为 Stylish 的等效插件,它类似于 GM CSS。 Chrome 也有类似的工具。
如果您的目标是向您正在创建的网站的用户提供此功能,我会考虑使用 HTML5 DOM 存储。
If you're aiming to personalize your own web experience I recommend a Greasemonkey script
that applies CSS programmatically. There is an equivalent plugin called Stylish which is the analog of GM for CSS. There are equivalents for Chrome.
If you're aiming to provide this functionality to users of a website you're creating, I'd look into storing personalized styling on the client-side using HTML5 DOM Storage.
您不需要任何插件或程序来执行此操作,只需在 Firefox 配置文件 目录,然后粘贴您想要的网页的自定义 CSS,例如:
您可以找到更多mozilla 开发者网站< /a>
You don't need any plugin or program to do that, just create the userContent.css file in your Firefox profile directory, and paste your custom CSS for the webpage you want, like:
you can find more customizable technique on the mozilla developer site
我确信有浏览器插件可以做这样的事情 - 特别是对于 Firefox 等。(如果没有,创建一个插件也不会太复杂。)
否则,我会调查 Greasemonkey,并编写一些自定义用户脚本来执行此操作。您可以将自定义用户脚本应用于所有站点,并使用本地数据存储来确定该站点之前是否已被访问过。
理想情况下,这样的插件将与浏览器历史记录集成,而不是复制历史记录存储(因为您的网络浏览器已经存储历史记录)。但是,如果您将浏览器历史记录配置为仅保存最近的天数,并且希望长期维护此“已读”帖子列表,则这可能并不理想。
I'm sure there are browser plugins to do something like this - especially for Firefox, etc. (If not, it wouldn't be too complicated to create one.)
Otherwise, I'd investigate Greasemonkey, and write some custom user scripts to do just this. You could have the custom user script apply to all sites, and use a local data store to determine if the site has been previously visited or not.
Ideally, instead of duplicating the history store (since your web browser is already storing history), such a plugin would integrate with the browser history. However, this may not be desirable if you have your browser history configured to only save the most recent # of days, and if you want this listing of "read" posts to be maintained longer-term.