From 76bb0734311bd3dc6e19c4bdf4364532fe72e787 Mon Sep 17 00:00:00 2001 From: HelloClyde Date: Sat, 1 Feb 2020 21:30:31 +0800 Subject: [PATCH] opt:support windows platform add platform win;change script position to first --- contentscript.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contentscript.js b/contentscript.js index 1157d1c..9713540 100644 --- a/contentscript.js +++ b/contentscript.js @@ -1,7 +1,7 @@ // see https://stackoverflow.com/questions/23202136/changing-navigator-useragent-using-chrome-extension var actualCode = '(' + function() { // Get the correct platform for navigator.userAgent - var candidates = ["Android", "iPhone", "iPod", "iPad"]; + var candidates = ["Android", "iPhone", "iPod", "iPad", "Win"]; var modifiedPlatform; for(var maybe of candidates) { if(navigator.userAgent.match(maybe)) { @@ -24,5 +24,5 @@ var actualCode = '(' + function() { // Inject custom js var s = document.createElement('script'); s.textContent = actualCode; -document.documentElement.appendChild(s); -s.remove(); \ No newline at end of file +document.documentElement.insertBefore(s, document.documentElement.firstChild) +s.remove();