Error when running external script

Post Reply
Sempervivum
Posts: 3
Joined: 01.12.17 22:07:42

Error when running external script

Post by Sempervivum » 01.12.17 22:14:16

Hallo,
frequently I have problems when including an external script. E. g. sweetalert: It works fine in a plain test page but not in TM.
My script:

Code: Select all

// ==UserScript==
// @name         Greeting
// @namespace    http://tampermonkey.net/
// @include      http://fussballcup.de/*
// @version      0.1
// @description  try to take over the world!
// @author       You
// @run-at       document-end
// @grant        GM_getValue
// @grant        GM_setValue
// @require      https://unpkg.com/sweetalert2@7.0.6/dist/sweetalert2.all.js
// ==/UserScript==


debugger;

(function() {
var vorhanden = 0;
var einladung = 0;
var call = 0;
var jetzt = new Date();

function firstUse()
{
    if(true)//!GM_getValue('Ingame_Greeting02'))
    {
        var modhtml = "<p>Vielen Dank für die Installation von diesem Tool, welche nun erfolgreich abgeschlossen wurde.</p><p> Dieses Tool wird versuchen das Spiel mit dem Forum ein wenig zu verknüpfen.</p><p>Viel Spaß mit dem Tool wünscht<br>mot33</p>";
        setTimeout(function() {
            swal("hallo");
        }, 1000);
        GM_setValue('Ingame_Greeting02', true);
    }
}

firstUse();
})();
Console says:
Uncaught (in promise) TypeError: Cannot set property onkeydown of #<Object> which has only a getter
at eval (eval at E_c (:3:92), <anonymous>:1007:24)
at new Promise (<anonymous>)
at Window.sweetAlert (eval at E_c (:3:92), <anonymous>:673:10)
at Window.eval (eval at E_c (:3:92), <anonymous>:1894:13)
at <anonymous>:2:270
at e.string.c.(anonymous function) (eval at exec_fn (:1:108), <anonymous>:51:132)
This is just an example, I encounter problems with numerous external scripts or plugins.

Any advice is welcome.
Best regards - Ulrich

User avatar
derjanb
Site Admin
Posts: 2326
Joined: 20.01.06 02:16:15
Contact:

Re: Error when running external script

Post by derjanb » 01.12.17 22:39:48

What browser do you use?
ImageIf you like what I'm doing, please consider a donation here. Image

User avatar
derjanb
Site Admin
Posts: 2326
Joined: 20.01.06 02:16:15
Contact:

Re: Error when running external script

Post by derjanb » 02.12.17 00:20:08

OK, I've figured out that it's Chrome or a derivate. Can you please tell me the exact browser and version and your operating system and version? Thanks.
ImageIf you like what I'm doing, please consider a donation here. Image

Sempervivum
Posts: 3
Joined: 01.12.17 22:07:42

Re: Error when running external script

Post by Sempervivum » 02.12.17 00:23:19

My browser is Opera V49. Windows 7 Home Premium, automatical updates.

User avatar
derjanb
Site Admin
Posts: 2326
Joined: 20.01.06 02:16:15
Contact:

Re: Error when running external script

Post by derjanb » 02.12.17 00:26:38

Ah good hint, I just tested this with:

Windows 10 Chrome - Version 62.0.3202.94 (Offizieller Build) (64-Bit)
Ubuntu 16.04 - Version 63.0.3239.70 (Official Build) beta (64-bit)
Ubuntu 16.04 - Version 64.0.3278.0 (Official Build) dev (64-bit)

And it's not happening here. I also found a code path that might result in such a error message, but I have no idea how to trigger it. So maybe I need to send you a special build with some more debug logs. :)
ImageIf you like what I'm doing, please consider a donation here. Image

User avatar
derjanb
Site Admin
Posts: 2326
Joined: 20.01.06 02:16:15
Contact:

Re: Error when running external script

Post by derjanb » 02.12.17 00:51:39

Ah OK, I can reproduce the issue. As a quick fix you can simply install

https://addons.opera.com/de/extensions/ ... display=en

and then install

https://chrome.google.com/webstore/deta ... fkfo?hl=de
or
https://chrome.google.com/webstore/deta ... glllgpjagf

from the Chrome Web Store. The Opera store was hacked some time ago and all passwords were reset. That's why I have not trusted them with a new passwort and also not updated the Tampermonkey Opera version for some time... :oops:
ImageIf you like what I'm doing, please consider a donation here. Image

Sempervivum
Posts: 3
Joined: 01.12.17 22:07:42

Re: Error when running external script

Post by Sempervivum » 02.12.17 01:27:10

Works fine now, that's really great! Thank you so much for your support!

Post Reply

Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest