avast / topee Goto Github PK
View Code? Open in Web Editor NEWGoogle Chrome Extension API for Safari
License: BSD 3-Clause "New" or "Revised" License
Google Chrome Extension API for Safari
License: BSD 3-Clause "New" or "Revised" License
^
Tried 2.2.0 for Swift 5.1.2, but it failed on 5.1.3
*** Downloading topee.framework binary at "swift 5.1.2"
*** Skipped installing topee.framework binary due to the error:
"Incompatible Swift version - framework was built with 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."
Falling back to building from the source
*** Skipped building topee due to the error:
Dependency "topee" has no shared framework schemes
Hi! I'm sorry if I misunderstood something.
I can run the demo extension from XCODE with appex target.
I try to start it with Demo target (Xcode builds and ran Demo.app), then I open Safari (12 or 13), go to preferences and enable the extension. Safari adds the extension icon and immediately removes it. Is it possible to run topee extension not form XCODE with appex target?
Thanks. Sorry again if it is not an issue.
"Incompatible Swift version - framework was built with 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1) and the local version is 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)."
Using Carthage Version: 0.34.0
I’ve started Demo Extension successfully. All Tests passed. Trying to integrate Topee framework to our blank extension, and we have a trouble - looks like background scripts do not inject successfully. The Webview has started, but on page about blank. No parameters get passed to web view… Do you have any idea what are we doing wrong?
The hardcoded user agent also has a hardcoded macOS version. To improve analytics, we should try to retrieve this value at runtime:
For debugging purposes it would be quite handy to be able to dump to the file system the contents of the background script as it is actually injected into the webview
I'm trying to follow the README instructions for using topee, and not getting very far. I haven't used Carthage before, but I think this should be working:
$ cat Cartfile
github https://github.com/avast/topee ~> 0.0.0
$ carthage update
Parse error: expected string after dependency type in line: github https://github.com/avast/topee ~> 0.0.0
[...add quotation marks...]
cat Cartfile
github "https://github.com/avast/topee" ~> 0.0.0
$ carthage update
*** Cloning topee
*** Checking out topee at "v0.0.7"
*** xcodebuild output can be found in /var/folders/m5/9r6jj7g57z5gkl_7441qzk440000gn/T/carthage-xcodebuild.LVjL6c.log
*** Downloading topee.framework binary at "Builds Topee using Xcode10"
*** Skipped installing topee.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1) and the local version is 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)."
Falling back to building from the source
*** Skipped building topee due to the error:
Dependency "topee" has no shared framework schemes
If you believe this to be an error, please file an issue with the maintainers at https://github.com/avast/topee/issues/new
[...do some googling...]
$ carthage update --no-use-binaries
*** Fetching topee
*** Checking out topee at "v0.0.7"
*** xcodebuild output can be found in /var/folders/m5/9r6jj7g57z5gkl_7441qzk440000gn/T/carthage-xcodebuild.z7BVLE.log
*** Skipped building topee due to the error:
Dependency "topee" has no shared framework schemes
If you believe this to be an error, please file an issue with the maintainers at https://github.com/avast/topee/issues/new
I have tried this in both a "Safari Extension App" new project and plain Cocoa app new project, with the same results.
I'm not sure what to try next (except forking and building on your demo app).
Hey I just came across this project since I want to get an already existing chrome extension to safari. I followed the instructions but unfortunately adding the Topee framework does not work.
Either I get an error in the SafariExtensionHandler.swift
that Topee
is not a module or some errors due to multiple target command.
I have Xcode 11.2.1 maybe something changed in the setup and how to link frameworks? The screenshots in the readmes do look a bit different compared to my version of Xcode.
deleted
I'm getting this error when trying to install it, it's clearly an issue with my Swift version, but being completely new to xcode, would you be able to help me get around it? Is there a way to run this with incompatible versions, do I need to install a previous xcode version to have the right swift to use this framework?
Thank you
Skipped installing topee.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1) and the local version is 5.3 (swiftlang-1200.0.28.1 clang-1200.0.30.1)."
Falling back to building from the source
*** Skipped building topee due to the error:
Dependency "topee" has no shared framework schemes
If you believe this to be an error, please file an issue with the maintainers at https://github.com/avast/topee/issues/new
Hi
I'm getting an incompatible Swift version with the latest version of XCode.
carthage bootstrap
*** Checking out topee at "v1.5.1"
*** xcodebuild output can be found in /var/folders/tc/p5gt0fqs2jv8qtr80m3xl8rh0000gn/T/carthage-xcodebuild.zozKmp.log
*** Downloading topee.framework binary at "chrome.tabs.update improvement"
*** Skipped installing topee.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."
Falling back to building from the source
*** Skipped building topee due to the error:
Dependency "topee" has no shared framework schemes
If you believe this to be an error, please file an issue with the maintainers at https://github.com/avast/topee/issues/new
If I pass --no-use-binaries
I get
carthage bootstrap --no-use-binaries
*** Checking out topee at "v1.5.1"
*** xcodebuild output can be found in /var/folders/tc/p5gt0fqs2jv8qtr80m3xl8rh0000gn/T/carthage-xcodebuild.xRA3he.log
*** Skipped building topee due to the error:
Dependency "topee" has no shared framework schemes
Currently we are hard-coding the user agent string because we were unsuccessful at determining the Safari and the WebKit versions at runtime. It would be great if we could figure out a way of retrieving these values at runtime.
I'm going to details what I did, as there are a few problems I encountered...
Create a new Safari App Extension project. (Calling it "MySAE".) Use Swift.
Run the default code in Safari. (Visiting webkit.org so that it activates.) Everything looks fine. (Except for a log line with "Unable to load Info.plist exceptions (eGPUOverrides)". I did some research and it seems to not matter.)
Create a Cartfile per the README; call carthage update
. Seems successful.
Add Topee.framework
to the extension's "Linked Frameworks and Libraries".
Try to run again. SIGABRT with this log:
dyld: Library not loaded: @rpath/Topee.framework/Versions/A/Topee
Referenced from: /Users/adam/Library/Developer/Xcode/DerivedData/MySAE-hcmmxabcnthfdsgpzehstqofyumr/Build/Products/Debug/MySAE.app/Contents/PlugIns/MySAE Extension.appex/Contents/MacOS/MySAE Extension
Reason: image not found
Do some googling. Add Topee.framework
to the app's (not extension's) "Embedded Binaries", which also adds it to the "Linked Frameworks and Libraries". Run again. Works.
Add topee-content.js
as a resource (Build Phases / Copy Bundle Resources), and set it as the first script under SFSafariContentScript
in the extension's Info.plist
.
Change SafariExtensionHandler
subclass to TopeeSafariExtensionHandler
. (And add import Topee
.)
Add TopeeSafariBackgroundScript
to plist, with empty array.
Run again. Seems to work, but this message appears: "MySAE Extension[9201:55667] Backgrounds scripts are taking too long to load. Check files for possible errors". (This message is why I created a fresh project and documented it.)
Create an empty background.js
; add it as a resource; add it to TopeeSafariBackgroundScript
.
Run. Same result. (The "taking too long" message is there for all following tests as well.)
Add a console.log
call to background.js
. Run. Log message does not appear in Xcode console.
Add entitlement for com.apple.security.network.client
to the extension. (This is present in the topee demo.) Run. Log message does appear in Xcode console.
Add the ping/pong code from the demo into the content and background scripts. So they look like this:
script.js
:
console.log('ADDING LISTENER');
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
console.log('got', JSON.stringify(message), 'from the background');
if (message.type === 'ping') {
sendResponse('content pong #' + message.value);
return;
}
});
console.log('SENDING MESSAGE');
chrome.runtime.sendMessage({
type: 'ping',
value: 1
}, console.log.bind(console, 'first'));
background.js
:
console.log('ADDING LISTENER TO BACKGROUND');
var bgPingCount = 0;
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
console.log('GOT MESSAGE', message);
if (message.type.indexOf('ping') != -1) {
sendResponse("background pong #" + message.value);
setTimeout(function () {
chrome.tabs.sendMessage(sender.tab.id, {
type: 'ping',
value: ++bgPingCount
}, {
frameId: sender.frameId
}, function (response) {
console.log(response);
})
}, 200);
}
});
Run. In the browser console, the "ADDING LISTENER" and "SENDING MESSAGE" logs appear, but not the "got" log. In the Xcode console, the "ADDING LISTENER TO BACKGROUND" log appears, but not "GOT MESSAGE". Setting breakpoints in the browser tells the same story: no response is received from the extension background.
That's as far as I got. I can't get the content and background scripts talking, so there's not much else I can do. I hope someone has some insight.
If you just skimmed the above list, there are a few problem places: steps 6, 10, 14, 16.
chrome.tabs.create({ url: 'some url', active: true }, (tab) => {// some code here})
tab
in callback is the tab which was active before create method calling.tab
has to be just created tab.Reference to old issue the latest changes didn't fix topee
#13
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.