Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #53870

Re: Tampermonkey, Edge

From Paul <nospam@needed.invalid>
Newsgroups alt.comp.os.windows-10
Subject Re: Tampermonkey, Edge
Date 2017-10-17 14:56 -0400
Organization A noiseless patient Spider
Message-ID <os5jog$l89$1@dont-email.me> (permalink)
References <14ywdz8enwyjz.dlg@example1357.net> <os0ec1$j32$1@dont-email.me> <azg3d8fpdvhe.dlg@example1357.net>

Show all headers | View raw


mechanic wrote:
> On Sun, 15 Oct 2017 15:53:40 -0400, Paul wrote:
> 
>> mechanic wrote:
>>> Anyone got this extension working in Edge - I've installed according
>>> to the website but not a peep? Lack of decent documentation doesn't
>>> help.
>> TamperMonkey on FF56 (reference the menu appearance of TM...)
>>
>>     https://s1.postimg.org/14qpvpw9a7/tamper_runs_56.gif
>>
>> TamperMonkey On MSEdge (15063 stream)
>>
>>     https://s1.postimg.org/21phhp18xb/tamper_on_edge.gif
>>
>> After installing TM in MSEdge via the Windows Store, go
>> back to the MSEdge settings : Extensions. Select the option
>> to "Show Button..." which causes TM to show in the address bar area.
>>
>> Then, left-click the new TM icon.
>>
>> Still no menu.
>>
>> Now, move your mouse to the left of the TM icon (which has a blue
>> line underneath it). Finally, the menu for TM will appear.
>>
>> At least MSEdge doesn't have any rough edges /s.
>>
>> HTH,
>>      Paul
> 
> Yes I found that menu already, still not a peep.
> 
> The template for roll-your-own script doesn't help,I tried that with
> JS statements in the user code section, no joy.

I got mine working.

First I tried enabling Developer Mode, but I don't really think
that helped.

*******

Initially, mine didn't seem to "run in immediate mode". When the
interface says "Enabled", your userscript does not trigger (load)
until you visit a particular site (or other trigger condition).

Since visiting the tampermonkey.net site was a highly likely
occurrence for the purposes of this experiment, I added
it to the header of my "Hello World" script. After I added
the @include, it started to work after being enabled. The
"wait for 10 seconds" "while loop", was originally intended
as a "CPU waster", so I could detect something was happening,
and isn't a key part of the script now. It was part of my
attempt at a debugging technique.

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://*/*
// @grant        none
// @include        http://tampermonkey.net/*      <---- must set a trigger
// ==/UserScript==

(function() {
     'use strict';

     // Your code here...
     var start = new Date().getTime();
     alert("Wait for 10 seconds");
     window.open('http://www.stackoverflow.com', '_blank', 'toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes');
     while (new Date().getTime() < start + 10000);
})();

Now, that script isn't entirely successful. The window.open
doesn't work, because of popup blockers. But I *did*
see the Alert pop up, and it helpfully includes
a tick box to not show the message again. The reason
this is important, is the trigger can occur many times,
causing the userscript to run many times as well.
For example, the above script opens four StackOverflow
separate windows (not tabs), when I attempt to visit

http://tampermonkey.net

*******

The results of my first userscript. It only triggers when
visiting a page on the tampermonkey.net site. And you cannot
see the four windows in the Task Bar that opened to
stackoverflow.com home page in the picture :-)

https://s1.postimg.org/5gsmb5m033/my_first_userscript.gif

@include seems to help...

    Paul

Back to alt.comp.os.windows-10 | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Tampermonkey, Edge mechanic <mechanic@example.net> - 2017-10-15 15:41 +0100
  Re: Tampermonkey, Edge Paul <nospam@needed.invalid> - 2017-10-15 15:53 -0400
    Re: Tampermonkey, Edge mechanic <mechanic@example.net> - 2017-10-16 18:40 +0100
      Re: Tampermonkey, Edge Paul <nospam@needed.invalid> - 2017-10-17 14:56 -0400
        Re: Tampermonkey, Edge mechanic <mechanic@example.net> - 2017-10-19 15:04 +0100

csiph-web