I need your help
|
|
I want replace <*input type='image' src='http://f.static.flickr.com/23/b.jpg' onclick="window.open('http://url.drleeuk.com/to/?aBn&z');return true;"> with <*img src='http://f.static.flickr.com/23/b.jpg'> all in the site: http://www.foobar.com <* = < Can you give me a full .user.js file? my email is ngn999#126.com . thank you very much ! |
|
|
It's completely untested, but the following should work... // ==UserScript==
// @name ngn999's script
// @include http://www.foobar.com/
// ==/UserScript==
inputs = document.evaluate('//input[@src="http://f.static.flickr.com/23/b.jpg"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null)
for (i = 0; i < inputs.snapshotLength; i++) {
(thisInput = inputs.snapshotItem(i)).parentNode.insertBefore(document.createElement("img").src = "http://f.static.flickr.com/23/b.jpg", thisInput)
thisInput.parentNode.removeChild(thisInput)
}Also, you didn't need to create this topic twice in different sections of the forum.
|
|
|
thank yuo very much!
|
|
|
// ==UserScript==
// @name ngn999's script
// @include http://www.foobar.com/
// ==/UserScript==
inputs = document.evaluate('//input[contains(@src,".jpg")]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null)
for (i = 0; i < inputs.snapshotLength; i++) {
(thisInput = inputs.snapshotItem(i)).parentNode.insertBefore(document.createElement("img").src = thisInput.src, thisInput)
thisInput.parentNode.removeChild(thisInput)
}
|
|
|
there is a problem:
|
|
|
because you don't have Greasemonkey installed? |
