-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is simple code that is executed to inject the script, which overwrites window.navigator in a way that Slack web app thinks we're using ChromeOS. On ChromeOS the left sidebar includes workspaces switcher panel. This trick allows non-ChromeOS users enjoy workspace switcher in Slack.
- Loading branch information
1 parent
4df18a7
commit 3fcd2c1
Showing
5 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const tag = document.createElement("script"); | ||
|
||
tag.innerHTML = "(function() { Object.defineProperty(navigator, 'userAgent', { value: navigator.userAgent + ' CrOS' }); })()"; | ||
|
||
document.documentElement.appendChild(tag); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Slack Workspace Switcher For All", | ||
"description": "Liberate your Slack in browser with a workspace switcher known from Chrome OS / native apps!", | ||
"version": "0.0.1", | ||
"icons": { | ||
"16": "images/icon16.png", | ||
"48": "images/icon48.png", | ||
"128": "images/icon128.png" | ||
}, | ||
"browser_action": { | ||
"default_icon": { | ||
"19": "images/icon48.png" | ||
}, | ||
"default_title": "Slack Workspace Switcher For All" | ||
}, | ||
"permissions": ["https://app.slack.com/"], | ||
"content_scripts": [ | ||
{ | ||
"all_frames": false, | ||
"js": ["content_script.js"], | ||
"matches": ["https://app.slack.com/*"], | ||
"run_at": "document_start" | ||
} | ||
], | ||
"content_security_policy": "script-src 'self'; object-src 'self'", | ||
"web_accessible_resources": ["images/*.*"] | ||
} |