-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extension structure and instructions
- Loading branch information
Showing
8 changed files
with
64 additions
and
2 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 @@ | ||
.DS_Store |
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 |
---|---|---|
@@ -1,2 +1,22 @@ | ||
# close-figma-tab | ||
Close Figma tab if you have "Open in Desktop App" active | ||
# Close Figma Tab - Chrome extension | ||
|
||
The extension will automatically close your Chrome tab after the Figma file opens in the [Figma desktop app](https://www.figma.com/downloads/). | ||
|
||
## Install from the Chrome Web Store | ||
|
||
You know the drill | ||
1. [Install extension](https://chrome.google.com/webstore/detail/close-figma-tab/oonojkdagfgjmempbfipokgjjigkoocj) from Chrome Web Store. | ||
2. Go and open files in Chrome like crazy | ||
|
||
## Install it manually: | ||
|
||
1. Download the [latest release](https://github.com/mamuso/close-figma-tab/releases/latest) of the extension and unzip it | ||
2. Launch Chrome | ||
3. Go to Extensions (`chrome://extensions/`) | ||
4. Toggle `Developer mode` | ||
5. Click `Load unpacked extension` | ||
6. Select `src` folder inside the unzipped folder | ||
|
||
## Something broken? | ||
|
||
Please, [file an issue](https://github.com/mamuso/close-figma-tab/issues) in the repository. |
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,3 @@ | ||
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { | ||
if(message.closeThis) chrome.tabs.remove(sender.tab.id); | ||
}); |
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,10 @@ | ||
(function() { | ||
// Adding a delay before chacking | ||
setTimeout(function(){ | ||
// Check if the desktop interstitial is open | ||
var interstitial = window.document.querySelectorAll("*[class^=\"desktop_app_interstitial\"]")[0] | ||
if(interstitial) { | ||
chrome.runtime.sendMessage({closeThis: true}); | ||
} | ||
}, 5000); | ||
})(); |
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 @@ | ||
{ | ||
"name": "Close Figma Tab", | ||
"version": "0.0.1", | ||
"manifest_version": 2, | ||
"description": "Close Figma tab if you have \"Open in Desktop App\" active", | ||
"homepage_url": "https://github.com/mamuso/close-figma-tab", | ||
"icons": { | ||
"48": "icons/48.png", | ||
"96": "icons/96.png", | ||
"128": "icons/128.png" | ||
}, | ||
"background": { | ||
"scripts": [ | ||
"js/background.js" | ||
], | ||
"persistent": false | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": ["http://*.figma.com/file/*", "https://*.figma.com/file/*"], | ||
"js": ["js/content.js"], | ||
"run_at": "document_end" | ||
} | ||
], | ||
"permissions": [ | ||
"activeTab" | ||
] | ||
} |