|
Let me preface this by saying I am not a Javascript programmer in any way. It's been almost a decade since I touched it seriously, and in that time the language (and paradigm) have changed enough to make whatever I did remember almost useless. With that said, I'm wondering if one of you guys can help me with a Greasemonkey script. The short version is that I'm trying to find a way to delete certain elements on the Facebook homepage (specifically, I want to get rid of "Highlights" items from people whom I don't care about.) The proof-of-concept works fine either using getElementsByClassName() or jQuery. The problem comes in the fact that Facebook uses some AJAX'ified way to load pages. When you click a link it doesn't send you to a new page, it (so far as I can tell) uses some Javascript to fetch and the new page's data, erases the current page data and replaces it with the new data. Effectively, it's loading new pages without ever having to actually load a new page. This is a problem because Greasemonkey scripts run when a page is loaded. If it never detects the page is reloaded, the script never runs. The effect is that my script works great when you first go to facebook.com, since that's a normal load, but if you click a link and then click a link back to the homepage, my script is completely oblivious because FB is 'cheating' on the load, and my script is never run, and the homepage is rendered unmolested. Do any Facebook users now what/how I can hook whatever function it uses to load new pages to then trigger my script? One lead I'm investigating is that FB seems to load some new iFrames on each cheater load, and those do trigger my script (though it then senses that the page being loaded, being simply a hidden data frame, isn't the homepage and then gives up.) Is there an easy way to maybe make my script, triggered inside an iFrame, 'break out' of the iFrame and then run on the containing page?
|
# ¿ Jun 3, 2009 03:35 |
|
|
# ¿ Apr 29, 2024 00:44 |
|
ronin109 posted:Since you are creating a GM script (hence, developing this for Firefox only) you can use the DOMSubtreeModified or DOMNodeInserted events to signal the deletion script.
|
# ¿ Jun 3, 2009 07:04 |
|
I'm looking for a JS library that lets me visualize network/force/etc. diagrams, but lets me use HTML objects (e.g., a div) as nodes. I've seen a few different graphing libraries that do network/force/etc. diagrams, but they render their nodes in their native type, like SVG or <canvas> graphics. I need to use intractable <div>s as the node.
|
# ¿ Sep 30, 2011 22:57 |
|
trinary posted:I haven't used it myself, but the approach taken by d3.js might be the thing you're looking for.
|
# ¿ Oct 2, 2011 06:38 |