Sleazy Fork is available in English.

Handy Image

Shows just fullsize Image with hotkeys & without pop-ups on many image-hosting sites

< Отзив за Handy Image

Отзив: Отлично - скриптът работи

§
Публикуван на: 01.04.2018

.createElement is not a function

I see it's protected by the script, but I'm currently using some other scripts involving this as well.
Is their a way to fix it? I did try using .protected_createElement() but it still doesn't work :(

OwynАвтор
§
Публикуван на: 02.04.2018

use delete document.createElement; before createElement in other scripts, this should restore default createElement

§
Публикуван на: 02.04.2018

use delete document.createElement; before createElement in other scripts, this should restore default createElement

Thank you so much! Everything works perfectly now :smiley: But I wonder there is an easy way to do it, since some script have so many "createElement"s in their scripts. Adding them one by one is so tedious, that would happen again when the other scripts update as well.
Are there any "magical" lines to do the task for us automatcally?

OwynАвтор
§
Публикуван на: 02.04.2018
Редактиран на: 02.04.2018

yea, you could do the same as script and use

function protected_createElement(el)
{
    delete document.createElement;
    var r = document.createElement(el);
    //unsafeWindow.document.createElement = null;
    return r;
}

but if you would want to avoid changing it after each update you could also write delete document.createElement;into custom js field in HandyImage settings so it'd restore createElement function after the image is loaded

§
Публикуван на: 02.04.2018

yea, you could do the same as script and use

function protected_createElement(el)
{
    delete document.createElement;
    var r = document.createElement(el);
    //unsafeWindow.document.createElement = null;
    return r;
}

but if you would want to avoid changing it after each update you could also write delete document.createElement;into custom js field in HandyImage settings so it'd restore createElement function after the image is loaded

Nice, thank you for the detailed instruction! Everything seems right now.

Публикувайте отговор

Влезте, за да публикувате отговор.