讨论 » 开发

HOW TO FIX Rewritten_script_code must exist ERROR

(已删除的用户 1144083)
§
发布于:2023-08-06

I NEED HELP FIXING THEASE ERRORS


Rewritten_script_code must exist

Default name is required - specify one with @name

Description is required - specify one with @description

ON LINE 1 AND 2

// ==UserScript==
// @name YouTube Custom Country Code
// @version 0.1
// @description Custom country code on YouTube

WITH THEASE SAYNTAXES

LINE 1
Unexpected tokest line 1, el 1
uspected taken at 11e 1, col 2.
Unexpected at line 1, es 1.
Expected LRRACE at line 1, co 36
Unexpected token at line 2, 60 36. Unexpected uten at line 2,2 27.

LINE 2
Unexpected token at line 2, co
Unexpected/' at line 2, col-2
Unknown @ rule: @name

IVE TRIED NOW FOR 3 HOURS NO MATTER WHAT I DO I CANT FIX IT.

NotYou管理员
§
发布于:2023-08-07

You probably forgot to put this

// ==/UserScript==

at the end of script meta block.

(已删除的用户 1144083)
§
发布于:2023-08-07

You probably forgot to put this

// ==/UserScript==

at the end of script meta block.

NO heres the first few lines


// ==UserScript==
// @name YouTube Custom Country Code
// @version 0.1
// @description Custom country code on YouTube
// @author donotprikel231
// @license MIT
// @match https://www.youtube.com/*
// @grant none
// @namespace http://tampermonkey.net/
// ==/UserScript==


I still get the ERROR

NotYou管理员
§
发布于:2023-08-07

Try this:

// ==UserScript==
// @name YouTube Custom Country Code
// @version 0.1
// @description Custom country code on YouTube
// @author donotprikel231
// @license MIT
// @match https://www.youtube.com/*
// @grant none
// @namespace http://tampermonkey.net/
// ==/UserScript==

(function() {
  const yourCountryCode = 'Hi!';
  const countryCode = document.getElementById('country-code');

  if (countryCode && yourCountryCode) {
    countryCode.textContent = yourCountryCode;
  }
})()
(已删除的用户 1144083)
§
发布于:2023-08-07

Try this:

// ==UserScript==
// @name YouTube Custom Country Code
// @version 0.1
// @description Custom country code on YouTube
// @author donotprikel231
// @license MIT
// @match https://www.youtube.com/*
// @grant none
// @namespace http://tampermonkey.net/
// ==/UserScript==

(function() {
  const yourCountryCode = 'Hi!';
  const countryCode = document.getElementById('country-code');

  if (countryCode && yourCountryCode) {
    countryCode.textContent = yourCountryCode;
  }
})()

NO not working

(已删除的用户 1144083)
§
发布于:2023-08-08

Try this:

// ==UserScript==
// @name YouTube Custom Country Code
// @version 0.1
// @description Custom country code on YouTube
// @author donotprikel231
// @license MIT
// @match https://www.youtube.com/*
// @grant none
// @namespace http://tampermonkey.net/
// ==/UserScript==

(function() {
  const yourCountryCode = 'Hi!';
  const countryCode = document.getElementById('country-code');

  if (countryCode && yourCountryCode) {
    countryCode.textContent = yourCountryCode;
  }
})()

Nevermind i got it to work

发布留言

登录以发布留言。