Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple script doesn't work on some websites #876

Closed
revolter opened this issue Feb 16, 2020 · 6 comments
Closed

Simple script doesn't work on some websites #876

revolter opened this issue Feb 16, 2020 · 6 comments

Comments

@revolter
Copy link

(Please fill out the issue template with your details)

Expected Behavior

Work.

Actual Behavior

Doesn't work.

Specifications

  • Safari: 13.0.4 (15608.4.9.1.3)
  • TM: 4.10.6108
  • OS: macOS 10.15.2 (19C57)

Script

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://github.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    alert("Da");
})();

I tried on github.com and dropbox.com and it doesn't work at all. On wikipedia.org, for example, the same simple alert works.

@revolter revolter changed the title Simple script doesn't work on some websited. Simple script doesn't work on some websites Feb 17, 2020
@erosman
Copy link

erosman commented Feb 19, 2020

@match https://github.com

Invalid match patterns: no path
ref: Match Patterns
About Permissions for Scripts and Style Sheets

Try

// only top page
 @match        https://github.com/

// all github pages
 @match        https://github.com/*

@revolter
Copy link
Author

That's how Tampermonkey generated it when I opened github.com and then used the "Create a new script...". I tried with https://github.com/ to no avail. Same with https://github.com/*.

The thing is that the add-on icon gets correctly badged:

image

But not alert shows up. Did it work for you?

@erosman
Copy link

erosman commented Feb 19, 2020

Did it work for you?

TBH, I was looking for something and I came across your post and replied with what I noticed.
I am afraid I am not a TM user to test it out.
Sorry

@derjanb
Copy link
Member

derjanb commented Feb 21, 2020

@revolter Are there console messages regarding a Content Security Policy violation?
If so, then this is a duplicate of #296 (comment)

@revolter
Copy link
Author

I don't think so, as it shows

image

regardless of whether the script is enabled or not.

Could you please try yourself to create a script that does anything on github.com and let me know if it works?

@derjanb
Copy link
Member

derjanb commented Jul 15, 2020

Duplicate of #296

@derjanb derjanb marked this as a duplicate of #296 Jul 15, 2020
@derjanb derjanb closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants