rs / SafariOmnibar

Safari plugin to add Chrome like omnibar in Safari
http://hackemist.com/SafariOmnibar/
417 stars 30 forks source link

making it work on Safari 8536.25 #94

Open eyalfishler opened 12 years ago

eyalfishler commented 12 years ago

Its true that you have an Omni bar with Safari 6, BUT u cant really change the default search engine. any update planned for fixing the code?

rs commented 12 years ago

Internals of safari changed a lot and I currently don't have the time to dig into it.

eyalfishler commented 12 years ago

rs - i made some good progress - the only thing i need to find is what function replaced goToToolbarLocation in the class BrowserWindowControllerMac. the swizzle reports "original method goToToolbarLocation: not found for class BrowserWindowControllerMac" what tool did you use to get the list of functions available for this class? (sorry but i have not much experience with debugging this kind of stuff - but no worries it will be solved and i will upload the code for that so everyone can change their default search)

eyalfishler commented 12 years ago

what i did till now was maninly to fix the crash which had to do with the removal of the search tab that doesnt exists now...

just need to be able to get the notification on gotolocation....

eyalfishler commented 12 years ago

ok this is a list of all the functions: .cxx_destruct .cxx_construct searchField _updateCloseKeyEquivalents _parentalControlsDidChange toggleFavoritesBar: toggleTabLineup: isShowingDownloadsPopover stopLoading: reloadObeyingLocationField: orderedTabViewItems orderedTabs moveTabFromOtherWindow:toIndex:andShow: isTabBarVisible hideTabLineupView toggleDownloadsPopover: browserWindowController releasePendingClosedWindowState sessionStateDidChange closeKeyEquivalentClosesTab toggleLocationBar: closeCurrentTab: closeInactiveTabs: toggleExtensionBar: toggleTabBar: numberOfNonDisposableTabs currentBrowserContentViewController changeTextEncoding: resizeAuxiliaryToolbarViewWithOldSize: editTitleOfBookmarksCollection: changeTitleOfBookmark:to: isTabLineupViewInstalled isTabLineupViewBeingInstalled newBookmarkFolder: toolbarInputFieldsIncludeSearchField goHome: didCommitLoadForContentViewController:loadingSingleResource: browserDocument startRocketEffectForContentViewController: locationFieldAndSearchFieldAreUnified updateReadingListButton makeLocationFieldOrWindowFirstResponder showTopSitesWall: webViewBlockedFromKeyViewLoopHasChanged: goBack: goForward: isFavoritesBarVisible startReadingListHopAnimationUsingStartPoint: favoritesBarView showFavoritesBarForReadingListAnimation: startReadingListHopAnimationUsingStartPointValue: hideFavoritesBarAfterReadingListAnimation: currentBrowserOrOverlayContentViewController currentBrowserWebView closeTabWithoutConfirming: canShowInputFields toolbarViewWindow selectSearchField: selectLocationField: locationField selectedTab dynamicBackMenu dynamicForwardMenu allowBookmarksChanges addBookmark: createWebClip: currentBrowserOrOverlayWebView usesWebKit2 setSearchFieldText: toggleShowBookmarks: newTab: showBookmarksView: showHistoryInBookmarksView: isAvailableForForcedLocationUsingWindowPolicy: createTabWithFrameName:position: createInactiveTabWithFrameName:position: selectTab: closeTabOrWindowWithoutConfirming: tryToCloseTab: tabViewItemForWebView: deleteBookmark: replaceTabsWithStates:allowGoBack:allowJavaScript:selectTabIndex: editAddressOfFavorite: editContentsOfFavorite: revealFavorite: zoomIn: zoomOut: showCertificateSheet: createTabWithPosition: createInactiveTabWithPosition: setToolbarsVisible: anyToolbarsVisible isStatusBarVisible setStatusBarVisible: setFrameProgrammatically: webViewProgressValueHasChanged: webViewProgressHasFinished: zoomToStandardSize: webViewLocationFieldIconHasChanged: webViewLocationFieldURLHasChanged: webViewDidUpdateReaderAvailability: webViewProgressHasStarted: searchForString: numberOfTabs webViewProgressHasStalled: webViewStatusMessageHasChanged: selectPreviousTab: selectNextTab: adjustedFrameForSaving: adjustedFrameForCascade:fromWindow: willShowCustomizeToolbarSheet tryToCloseWindowWhenReady windowTitleNeedsUpdate firstResponderMightHaveChanged isTogglingFullScreenMode tabBarView insertInOrderedTabViewItems: insertInOrderedTabViewItems:atIndex: replaceInOrderedTabViewItems:atIndex: removeFromOrderedTabViewItemsAtIndex: tabSwitcherWidthDidChange _updateKeyboardLoop safariBrowserWindowLocationFieldURLDidChange: revealContentUnderFullScreenToolbar updateSecurityUI updateStatusMessage safariBrowserWindowUpdateLocationFieldIconNow: safariBrowserWindowUpdateLocationFieldProgressBarNow: safariBrowserWindowUpdateLocationFieldTextNow: safariBrowserWindowUpdateStopReloadButtonNow: updateToggleBookmarksButton updateReaderButton webSearchCompletionController urlCompletionController updateTabProgressIndicatorForView: isLocationBarVisible setLocationBarVisible: setFavoritesBarVisible: setTabBarVisible: startFluidProgressForContentViewController: updateFluidProgressForContentViewController: finishFluidProgressForContentViewController: cancelFluidProgressForContentViewController: toolbarController locationFieldIsReflectingSearchTerms locationFieldIsFirstResponder searchFieldIsFirstResponder webViewMainContentViewDidChange: tryToCloseOtherTabs: windowType browserWindowController:mainDocumentDidFirstLayout: browserWindowController:mainDocumentDidLoad: _updateReaderButton: _canAddBookmark _canCloseTab: tryToCloseTabWhenReady: tryToCloseOtherTabsWhenReady: _canGoBack _currentTabPlacementHint _replaceTabSwitcher:visitedTabs: _canGoForward _goToLocationFieldURLWithWindowPolicy: _moreThanOneTabShowing _moveTabToNewWindow: _isShowingBookmarks _currentBookmarksViewController _currentBrowserContentViewControllerIncludingTabLineup: _applyNewBrowserViewBehavior:usingReferenceBrowserContentViewController: _showLocationBarTemporarilyIfHidden _makeLocationFieldFirstResponder _showTabBarAndUpdateCloseKeyEquivalentsIfNeeded _performWebSearchWithWindowPolicy: _canPrintFromToolbar selectedTabIndex _showTabAtIndex: _makeSearchFieldFirstResponder _locationFieldIsEmpty _locationFieldIsShowing _locationFieldIsReflectingCurrentURL _locationFieldTextIsWorthyOfHonoringOnReload _performLocationFieldActionWithWindowPolicy: _reloadHonoringLocationField: _reloadTab: canReloadTab: _goToBookmarksUsingWindowPolicyFromCurrentEvent _goToBookmarksUsingWindowPolicyFromCurrentEventSelectingBookmark: _windowIsFullHeight _toggleToolbarIgnoringCurrentEvent: _isTogglingFullScreenBar _toggleFavoritesBarWithAnimation: isEnteringOrInFullScreenMode _toggleStatusBarWithAnimation: _toggleTabBarWithAnimation: _canShowSharingServicePicker readingListSidebarView _windowContentView _revealOrCoverSidebar:animate: _readingListHopEndPoint _locationFieldIsReflectingLocationFieldURL toggleReader: _newWindowShouldBeUnbuffered _collectViewInfoForResizing _setUpTabBar _setUpTabForView:position:andShow: _oneTimeSetUpForToggleBookmarksButton _setUpLocationBar _setUpFavoritesBar _setUpStatusBar _setupExtensionBars _updateToggleBookmarksButton _originalHeightForView: _recentSearchesCleared: _iconDidChange: _allIconsRemoved _webPreferencesChanged: _willEnterFullScreen: _didEnterFullScreen: _willExitFullScreen: _downloadDidBegin: _searchProviderDidChange _extensionWasDisabled: _extensionWasEnabled: _tellUserThatAppIsHosed frameAutosaveIsAllowed _toggleLocationBarWithoutSavingConfiguration _isShowingBar:ignoringFullScreenAlwaysVisibleBars: _setTabBarVisible: _anyExtensionBarsVisible _shouldShowFavoritesBar _alwaysShowTabBar _setExtensionBarsVisible: _locationFieldURL _urlStringForLocationFieldIcon _setLocationFieldNonURLText: _updateUIAfterProgrammaticLocationFieldTextChange _stopReloadButtonShouldBeVisible _findTabForView: _updateSearchSnapBackButton _tryToAutofillMainFrameSoonForWebView: _shouldShowTabBar searchForString:withWindowPolicy: _searchWebForString:withWindowPolicy: _locationFieldText _certificateTrustSheetDidEnd:returnCode:contextInfo: _defaultSearchProviderDisplayName _startDownloadHopAnimationFromPoint: _createTabWithView:atIndex:andShow: _createTabWithFrameName:andShow:position: _showTab: _closeTabWithoutConfirming: _confirmClosingEditedTab: _confirmClosingOtherTabsIfAnyAreEdited: _releaseTabSwitchersForBackForward _releaseTabSwitcher: _updateDocumentIsEdited _removeTabViewItem: _closeTabWithoutConfirming:allowUndo: _createTabWithView:atIndex:andShow:withBrowserTab: _closeWindowIfNoTabs tabBarHeight _firstResponderView _hideLocationBarIfTemporary goBackOrForwardFromSegmentedControl: zoomInOrOutFromSegmentedControl: _canCreateWebClip _canGoHome printFromToolbar: autoFill: _canAutoFill closeOtherTabsFromMenu: moveTabToNewWindowFromMenu: moveCurrentTabToNewWindow: closeTabFromMenu: canCloseSelectedTab reloadTabFromMenu: reloadAllTabs: canCreateNewTab showSharingServicePicker: toggleCloudTabsPopover: _canShowCloudTabsPopover toggleStatusBar: isTabLineupEnabled canReloadObeyingLocationField toggleReadingList: isReadingListSidebarShowing _finishUninstallingTabLineupView _windowDidResizeToEnterFullScreen _windowDidResizeToExitFullScreen _safari_windowDidEndLiveResize _bestTabSwitcherWidthForCurrentPage _windowWidthForTabSwitcherWidth: goBackAndFlashToolbarButton: goForwardAndFlashToolbarButton: _formCompletionControllerHandleKeyEvent: _sheetPositionTop _displayCloseConfirmation updatePendingClosedWindowState _stopSetStatusMessageTimer _cancelSpringToFront _tellAppControllerWindowWillClose _windowURL _URLCompletionController _updateLocationFieldDetailString _updateSecurityPillVisibility _searchCompletionController _locationFieldTextLooksLikeWebSearch _performLocationFieldAction: _appendSlashAndCollapseSelectionInLocationField _trackSearchButtonForEvent: stopOrReload: _startObservingPrivateBrowsingSheetWasCanceledNotifications _confirmDisablePrivateBrowsingSheetDidEnd:returnCode:contextInfo: locationTextFieldPerformPrivateBrowsingButtonAction: locationTextFieldPerformStopReloadButtonAction: locationTextFieldPerformSecurityPillAction: _backListMenuForButton: _forwardListMenuForButton: _scheduleSpringToFront _automaticallyHideTabBarForTabDrag _searchFieldIsEmpty _focusLocationFieldAfterTabSwitch _removeAllTabCloseUndoActions _updateSecurityPillWithEVCertificateTitle: _currentPageIsSecureEnoughToShowLock _updateEVButtonForHost:certificateChain: _selectedMainWebFrame _tryToAutoFillAfterLoadingFrame: _stopFocusLocationFieldAfterTabSwitchTimer _handleNavigationAction:request: _setExtensionBar:visible:withAnimation: _updateExtensionBarDividers _setStatusMessage:ellipsize: showTabLineupViewWithEvent: pinchEventMonitorHandler: _tearDownPinchEventMonitor _willUnselectTab: tabContentTopMarginInTabLineupView _updateTabBarVisibilityForTabLineup _stopPostponingFullScreenSubviewResizing _setupPinchEventMonitor _didSelectNewTab:withLastSelectedTab: morphingDragImage:draggingEntered: morphingDragImage:draggingUpdated: morphingDragImage:draggingExited: morphingDragImage:performDragOperation: locationTextFieldBecameFirstResponder: locationTextFieldAutocompleteSelectionDidChange: locationTextFieldMarkedTextDidChange: locationTextFieldCanDisplaySearchTerms: locationTextFieldShouldSelectAllAfterMouseDown: locationTextField:mouseUpInPrivateBrowsingButton: locationTextField:mouseUpInStopReloadButton: locationTextField:mouseUpInSecurityPill: locationTextField:trackSearchButtonForEvent: bookmarkToDragFromSiteIconInLocationTextField: locationTextFieldURLDropped: browserWindowTitleBarURL: browserWindow:shouldGoToURL: window:performKeyEquivalent: window:willHandleKeyEvent: window:willHandleMouseDownEvent: imageHopParentWindow imageHopAnimationDidFinish: createFluidProgressStateForContentViewController: clearFluidProgressStateForContentViewController: progressStateForContentViewController: progressStateForCurrentContentViewController fluidProgressRocketAnimationDidComplete currentWebViewSize goToActivatedCompletionListURL: goToLocationFieldURL: _localSearchStringFromWebSearchString: performWebSearch: searchProviderConfirmationDidEnd:returnCode:contextInfo: reloadIgnoringLocationField: installSidebarWithView:animate: uninstallSidebarWithAnimation: startReadingListHopAnimationFromMouseLocation defaultFrame slideInFavoritesBarNewTabButtonIfNecessary slideOutFavoritesBarNewTabButtonIfNecessary locationFieldTextForRestoring restoreLocationFieldText: unifiedFieldPlaceholderString webViewFrameForWebViewSize: setLastMouseClickPosition: downloadFailedToHopToDockFromPoint: orderedTabContentViews createTabWithFrameName:atIndex:andShow: replaceEmptyTabWithTabs: moveTab:toIndex: updateTabLabelForView: tabBarHeightForSingleTabWindow isAutoFilling extensionToolbarClient windowWillOrderOnScreen: searchField:shouldRememberSearchString: searchField:trackSearchButtonForEvent: morphingDragImage:enteredWindow: morphingDragImage:exitedWindow: willSelectTabViewItem didSelectTabViewItem tabsWereRearranged tabBarViewUpdateTabTitlesSoon: tabBarViewUpdateTabTitlesNow: webViewLoadingStatusHasChanged: webViewFormEditedStatusHasChanged: webViewReaderDidActivate: webViewReaderWillDeactivate: webViewReaderDidDeactivate: webFrameLoadStarted: webFrameLoadCommitted: webFrameLoadFinished:withError: webFrame:willPerformClientRedirectToURL: shouldBlockTabsFromResizing bar:handleNavigationAction:request: toolbarItem:handleNavigationAction:request: browserWindowForBar: browserWindowForToolbarItem: bar:showWithAnimation: bar:hideWithAnimation: shouldReaderIgnoreWindowChangeNotificationsForWebView: detachTabViewItemFromTabSwitcher: showTabLineupViewAnimationDidFinish trackTabLineupPinch tabLineupViewDidSelectTab: setWindowType: fluidProgressController tabViewItemPinnedToOverflowTabBeforeEnteringTabLineup _clearStatus _dismissPrivateBrowsingSheet _collapsibleBarsAreInFullScreenToolbarWindow _updateFullScreenAuxiliaryToolbarViewSizes _stopObservingPrivateBrowsingSheetWasCanceledNotifications _postPrivateBrowsingSheetWasCanceledNotification _toggleBar:withAnimation:isShowing: _anyExtensionBarsVisibleIgnoringFullScreen: _setUpTabForView:atIndex:andShow: _setUpTabForView:atIndex:andShow:withBrowserTab: _undoCloseTabAtIndex:andShow: _releaseTabSwitcherForGoingBack _releaseTabSwitcherForGoingForward _confirmCloseWindowDidEnd:returnCode:contextInfo: _confirmCloseTabForEditedFormDidEnd:returnCode:contextInfo: _closeOtherTabsWithoutConfirming: _confirmClosingOtherTabsIfAnyAreEditedDidEnd:returnCode:contextInfo: _shouldShowSecurityPillInLocationField _updateSearchFieldProviderText _makeFirstResponder: _abortURLAndSearchCompletions _setUpSearchField _locationFieldIsReflectingURL: _completionListDidShow: _completionListSelectionDidChange: _completionListDidHide: _completionListHintDidChange: _toggleBar:withAnimation:isShowing:forceMaintainFullHeight: _barBackgroundFromBar: _resizeBarsWithAuxiliaryToolbarViewOldSize: _unlockMenuBarIfNeeded _lockMenuBarIfNeeded _toggleFullScreenBar:withAnimation:isShowing: _setFavoritesBarNewTabButtonVisibility: _screenForWindow _setAutoresizingMasksForOrderedViews:toResizeOnly: _setStatusMessageNow _defaultStatus _tryMultipleURLs:windowPolicy: _performSpringToFront _anyExtensionBarsVisibleExcludingBar:ignoringFullScreen: _insertExtensionBars:withAnimation: _anyExtensionBarsVisibleExcludingBar: _removeCollapsibleBarView:needsDisplay: _insertCollapsibleBarView:atIndex:withOriginalHeight: _setUpExtensionBar:withFrame: _downloadHopStartPoint _downloadHopEndPoint _currentDocumentView _automaticallyShowTabBarForTabDrag _lastVisitedTabIgnoring: _isShowingTopSites _prepareBarsToEnterFullScreen _prepareBarsToExitFullScreen _internalResizeAuxiliaryToolbarViewWithOldSize: _startSidebarRevealAnimation: _isWindowFullScreenToolbarWindow: isToolbarInFullScreenToolbarWindow _setShouldDisableFrameSizeUpdates: _prepareTopLevelViewsToToggleFullScreen _finishExitingFullScreen _forceTabLineupViewToLayoutAndDisplay _positionAndResizeFullWidthBar:atOriginY: _hasAttachedSheet dealloc windowDidBecomeKey: encodeRestorableStateWithCoder: restoreStateWithCoder: validateUserInterfaceItem: validateMenuItem: doCommandBySelector: control:textView:doCommandBySelector: cancel: windowWillResize:toSize: windowShouldClose: windowWillReturnFieldEditor:toObject: windowWillUseStandardFrame:defaultFrame: window:willPositionSheet:usingRect: window:willUseFullScreenContentSize: windowDidFailToEnterFullScreen: windowDidResize: windowDidMove: windowDidResignKey: windowDidBecomeMain: windowDidResignMain: windowWillClose: windowDidMiniaturize: windowDidDeminiaturize: windowDidEndSheet: controlTextDidEndEditing: controlTextDidChange: windowNibName setDocument: showWindow: shouldCloseDocument menuNeedsUpdate: menuHasKeyEquivalent:forEvent:target:action: windowDidLoad noResponderFor: swipeWithEvent: _attachedSheet isInFullScreenMode _didExitFullScreen:

eyalfishler commented 12 years ago

i cant seem to find a function that is called when a search or address is triggered, i do get a CB on performWebSearch but no text to change with it for the address location

eyalfishler commented 12 years ago

found it ! done :) send me an email eyalfishler@gmail.com and i'll send you the code so u can merge it to your's. we now have an Omnibar for Safari 6 (8536.25)

rs commented 12 years ago

Congrat. Why don't you submit a pull request?

noizo commented 12 years ago

Guys? Where do we have the safari omnibar for safari 6?

stefanschmidt commented 12 years ago

Try this: http://safarikeywordsearch.aurlien.net

noizo commented 12 years ago

@stefanschmidt thank you very much!