CN112541139A - Universal and extremely simple html hypertext bookmark importing and exporting green program - Google Patents

Universal and extremely simple html hypertext bookmark importing and exporting green program Download PDF

Info

Publication number
CN112541139A
CN112541139A CN202011620214.0A CN202011620214A CN112541139A CN 112541139 A CN112541139 A CN 112541139A CN 202011620214 A CN202011620214 A CN 202011620214A CN 112541139 A CN112541139 A CN 112541139A
Authority
CN
China
Prior art keywords
bookmark
self
icon
browser
menu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011620214.0A
Other languages
Chinese (zh)
Inventor
芮爱平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ha Ha Ya Ya Internet Co Ltd
Original Assignee
Shenzhen Ha Ha Ya Ya Internet Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ha Ha Ya Ya Internet Co Ltd filed Critical Shenzhen Ha Ha Ya Ya Internet Co Ltd
Priority to CN202011620214.0A priority Critical patent/CN112541139A/en
Publication of CN112541139A publication Critical patent/CN112541139A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9562Bookmark management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/134Hyperlinking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Abstract

A green program traditional browser for importing and exporting universal extremely simple html hypertext bookmarks has some complex operations, such as: the bookmark imported by the Google browser is a three-level menu, and five items exist when the Google browser enters an import window: browsing history, bookmarks, saved passwords, etc., in addition to bookmarks, other redundancies. The browser is evolved to a simple full screen mode, and the menu is needed to reduce the hierarchy, so that the user experience is improved. The invention content is as follows: and (3) right-clicking a menu at any blank position of a browsed webpage, adding bookmark management, and performing secondary menu: the bookmark is led out and led in, one level of menu is saved compared with a Google browser, and right clicking any blank place is convenient. The default import source file of the 'import bookmark' is the default file of the export bookmark; if the folder icon is clicked, the folder is opened to search for any Html bookmarks from google, 360 browser, etc., and "overlay or add bookmarks" is selected. The "export bookmark" is saved in the "download" folder by default. The developed reduced full screen browser implements the above described functionality, only 227 lines of code.

Description

Universal and extremely simple html hypertext bookmark importing and exporting green program
Technical Field
A very simple technique for browser bookmark management.
Background
Through 26 years of development, the traditional browser forms a fixed style, and some operations are very complicated, such as: the bookmark importing of the google browser is a three-level menu (figure 1), and the bookmark importing window is accessed, and five items are as follows: browsing records, favorites/bookmarks, saved passwords, search engines, and auto-populating form data (fig. 2), which is redundant except for favorites/bookmarks. The browser is inevitably selected when the browser evolves to a simple full-screen mode, and the browser is urgently required to be led into a bookmark menu to reduce the hierarchy, so that the efficiency is improved, and the user experience is improved.
Disclosure of Invention
The invention content is as follows: and (3) right clicking a popup menu at any blank position of a browsed webpage to increase bookmark management, wherein a secondary menu (figure 3) comprises: the bookmark is led out and led in, one level of menu is saved compared with a Google browser, right clicking any blank by a mouse is very convenient, and user experience is greatly improved. The 'import bookmark' window (figure 4) has a default import source file, namely an export bookmark default file; if the right folder icon is clicked, the folder is opened to search (fig. 5) any Html hypertext bookmark files (fig. 6) originally stored in google, 360, fire fox, IE or Edge browsers, and "cover or add bookmark" can be selected (fig. 7), the system adopts the same segment of code to import the icon, Url address, short title and long title of the common browser bookmark, and after importing the google bookmark in the example, my bookmark has three columns (fig. 8). And when the IE bookmark is imported, the icon is ignored, and because the bookmark file of the IE does not contain icon information, the icon needs to be downloaded in real time, so that the user experience is influenced, and the icon is updated when the IE bookmark is left on the internet. The export bookmark displays an export My bookmark backup save window (figure 9) which is saved in a download folder by default. The bookmark management-importing and exporting functions are realized in the hahahahahayaya extremely-speed simple full-screen browser successfully developed by the inventor, the program is very concise, only 227 lines of python codes are needed, and the environment is protected.
Drawings
FIG. 1 is a schematic diagram of "import bookmark and set" three-level menu for Google browser
FIG. 2 is a schematic diagram of five options of "import bookmark and set" window of Google browser
FIG. 3 is a very fast and simple anti-theft function of right-clicking menu "bookmark management" in blank space of Linux full-screen browser web page
FIG. 4 is a drawing of a bookmark-bookmark source window of a hahahayaya ultra-fast simple anti-theft Linux full-screen browser
FIG. 5 shows bookmark sources imported to hahahahayaya ultra-fast simple anti-theft Linux full-screen browser
FIG. 6, hahahayaya extremely fast simple anti-theft Linux full-screen browser interface from bookmark import to bookmark source selection
FIG. 7 is a drawing illustration of how the import bookmark of hahahayaya ultra-fast simple anti-theft Linux full-screen browser-you want to cover the existing bookmark-interface
FIG. 8 is a very fast and simple anti-theft Linux full-screen browser's import bookmark-My bookmark-three-row bookmark interface
FIG. 9 shows exporting bookmarks to exporting my bookmarks to backup storage to an interface of a hahahahahayaya ultra-fast and simple anti-theft Linux full-screen browser.
Detailed Description
The development kit of Python 3.7 version language, PyQt5 and PyQtWebEingine of the Linux CentOS 7.7 system is adopted to realize the 'extremely-fast simple anti-theft Linux full-screen browser', and the development platform is Pycharm communication 2019.3. In a developed hahahayaya extremely-fast simple anti-theft full-screen browser, the bookmark management-import and export functions are realized, the program is very concise, only 227 lines of python codes are needed, and the environment is protected. The annotation line starts with a #, and/is a fold line connector, so that the simple and understandable codes are not annotated, important codes for realizing the software functions of bookmark management-import and export are displayed in bold, and the codes are as follows:
import sys,json,os,datetime,warnings,base64
from subprocess import Popen
from PyQt5.QtCore import QUrl, Qt, QCoreApplication, pyqtSignal, QDir, QFileInfo, /
/ QStandardPaths
from PyQt5.QtWidgets import QApplication, QMainWindow, QLineEdit, QToolBar, QTabWidget, /
/ QWidget, QHBoxLayout,QDialog, QPushButton, QProgressBar, QMenu, QLabel, /
/ QMessageBox,QAction,QTreeView,QFileDialog
from PyQt5.QtGui import QIcon,QDesktopServices,QCursor,QStandardItemModel,QStandardItem
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings, /
/ QWebEngineDownloadItem, QWebEnginePage
from pynput.keyboard import Controller,Key
third party development kit for importing data # into
download_item_ls = []
# store download task array variable
webview_group = []
# store Web instance array variables
webview_parent_group = []
# store Web Page parent instance array variables
… … omit extraneous code
class myQMainWindow(QMainWindow):
# rewrite Main Window class QMainWindow
def __init__(self, parent=None):
super(myQMainWindow, self).__init__(parent)
def closeEvent(self, QCloseEvent):
# rewrite main window closing method
os.system('poweroff -h')
# Call System Command execution shutdown
_url_role = Qt.UserRole + 1
# bookmark role variable
_default_bookmarks = [
[ 'my bookmark' ],
['http://www.hahayaya.com/', 'hahayaya', 'bookmarks/hhyy.png'],
['https://tv.cctv.com/live/cctv15_spm=C28340.PO8MkQf6Euyz.S91117.48',/
v 'CCTV music channel', 'books/163 _ music.jpg' ],
[ 'https:// www.youku.com/', 'Youku.jpg' ],
[ 'https:// v.qq.com/', 'flight video', 'hooks/tencent.jpg' ],
[ 'a browsing footprint' ],
]
# Default bookmark
class BookmarkWidget(myQMenu):
# rewrite bookmark class, inherit myQMenu class
open_bookmark = pyqtSignal(QUrl)
# set Signal variable open _ bookmark
changed = pyqtSignal()
# set Signal variable changed
def __init__(self):
# initialization method
super(BookmarkWidget, self).__init__()
self._model = self._create_model(self,self._read_bookmarks())
Reading bookmark file content or creating bookmark model variable by default bookmark variable with # calling _ read _ bookmarks method
self._model.rowsInserted.connect(self._changed)
self._model.rowsRemoved.connect(self._changed)
self._model.dataChanged.connect(self._changed)
self._model.item(1, 0).removeRows(0,self._model.item(1, 0).rowCount())
Item (1, 0) of the browsing footprint, and item (0, 0) of the bookmark
def _changed(self):
Method for triggering change of # bookmark variable
self.changed.emit()
def _action_activated(self, index):
Method for triggering # bookmark after being clicked
self.open_bookmark.emit(self.sender().data())
def _config_dir(self):
Config stores bookmark files and browser cache pictures
return '{}/Rui_Browser'.format(QStandardPaths.writableLocation( /
/ QStandardPaths.ConfigLocation))
… … omit extraneous code
def _create_item(self, url, title, icon):
# method of creating bookmark data item
result = QStandardItem(title)
result.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable)
result.setData(url, _url_role)
if icon is not None: result.setIcon(icon)
return result
… … omit extraneous code
def _serialize_model(self, model, directory):
Method for # bookmark data model serialization processing
result = []
folder_count = model.rowCount()
for f in range(0, folder_count):
folder_item = model.item(f)
result.append([folder_item.text()])
item_count = folder_item.rowCount()
for i in range(0, item_count):
item = folder_item.child(i)
entry = [item.data(_url_role).toString(), item.text()]
icon = item.icon()
if not icon.isNull():
icon_sizes = icon.availableSizes()
try:
largest_size = icon_sizes[len(icon_sizes) - 1]
icon_file_name = '{}/icon{:02}_{:02}_{}.png'.format(directory, f, i, /
/ largest_size.width())
icon.pixmap(largest_size).save(icon_file_name, 'PNG')
entry.append(icon_file_name)
except:pass
result.append(entry)
return result
… … omit extraneous code
def write_bookmarks(self):
Json file method for saving bookmark content to local bookmarks
dir_path = self._config_dir()
native_dir_path = QDir.toNativeSeparators(dir_path)
dir = QFileInfo(dir_path)
if not dir.isDir():
if not QDir(dir.absolutePath()).mkpath(dir.fileName()):
warnings.warn('Cannot create {}.'.format(native_dir_path), RuntimeWarning)
return
serialized_model = self._serialize_model(self._model, dir_path)
bookmark_file_name = os.path.join(native_dir_path, 'bookmarks.json')
with open(bookmark_file_name, 'w') as bookmark_file:
json.dump(serialized_model, bookmark_file, indent = 4)
… … omit extraneous code
def export_common(self,data_model):
General method for deriving bookmarks
row_count = data_model.rowCount()
my_bookmark_html1 = ''
for r in range(0, row_count):
item = data_model.child(r)
image, title, icon = '', item.text(), item.icon()
if not icon.isNull():
icon_sizes = icon.availableSizes()
try:
largest_size = icon_sizes[len(icon_sizes) - 1]
icon_file_name = 'bookmarks/icon/r0.png'
icon.pixmap(largest_size).save(icon_file_name, 'PNG')
with open(icon_file_name, 'rb') as fp:image = fp.read()
fp.close()
image = 'data:image/png;base64,' + str(base64.b64encode(image))
image = image.replace("b'", '')
image = image[0:len(image) - 1]
except:pass
url = item.data(_url_role).toString()
my_bookmark_html1 += ' <DT><A HREF="' + url + '" ADD_DATE="0" ICON /
/ ="' + image + '">' + title + '</A><br>'
return my_bookmark_html1
def _export_bookmarks(self,webview,dest_file):
Method of deriving my bookmark
my_bookmark_html = '<!DOCTYPE NETSCAPE-Bookmark-file-1><br>' + '<!-- This
/ is an automatically generated file. DO NOT EDIT! -->'
my_bookmark_html += '<META HTTP-EQUIV="Content-Type" CONTENT= /
/ "text/html; charset=UTF-8">' + '<TITLE>Hahayaya Bookmarks</TITLE><H1> /
[ My bookmarks ] < br > 1'
my_bookmark_html += self.export_common(self._model.item(0,0)) + ' </DL><p> /
/ <br>'
try:
with open(dest_file, 'w', encoding='utf-8') as /
/ bookmark_file:bookmark_file.write(my_bookmark_html)
bookmark_file.close()
Information (webview, ' derive my bookmark ', ' my bookmark derivation success! \ n bookmark
The/backup file is: ' + dest _ file)
except: QMESSAGEBOX. information (webview, ' export my bookmark ', ' My bookmark export failed! \ n
'may be written because of no authority')
def png_to_jpg(self,pngfile,title):
Method for switching common website icons
if not pngfile.endswith('.png'):return pngfile
Fine ('Jingdong') > -1: return 'img/jd.jpg'
Fine ('Aiqi skill') > -1: return 'img/iqiyi.jpg'
Fine [ new wave ] > -1: return 'img/sina [ jpg ]'
Fine ('Yokou') > -1: return 'img/youku.jpg'
else:return pngfile
def _import_bookmarks(self,imported_bookmark,webview):
Method for importing bookmark
row1 = self._model.item(0, 0).rowCount()
Comment = qmessagebox (webview, "import bookmark", "do you want to cover existing bookmark", ″, (will you want to cover existing bookmark) ", (will you want to cover existing bookmark)
/ QMessageBox.Yes | QMessageBox.No)
try:
for k in imported_bookmark:
url,title,icon = QUrl.fromUserInput(k[0]),k[1],QIcon(self.png_to_jpg(k[2],k[1]))
self._model.item(0, 0).appendRow(self._create_item(url, title, icon))
if button == QMessageBox.Yes:self._model.item(0, 0).removeRows(0, row1)
self.changed.emit()
return True
except:
Information (webview, ' bookmark import ', ' bookmark import failure! \ n may be due to import
A file format error. ')
return False
@staticmethod
def short_title(t):
Method for acquiring short title of webpage
isEnglish = all(ord(c) < 128 for c in t)
# judges whether the Web Page heading is English
if isEnglish == True:n=38
else:n=19
return t[0:n]
class Browser(myQMainWindow):
# custom Browser class, inherit myQNainWindow class
def __init__(self, mainWin, webview=None):
super().__init__(mainWin)
self.mainWin,self.webview,self.part = mainWin, webview, ''
Main win, self webview, self part stores the parent instance of full screen play video
self.initUI()
Method for calling initialization interface
def initUI(self):
Method for initializing interface
if self.webview == None:
# is the first page
self.webview = WebView(self)
# tone WebView class instantiation
self.webview.load(QUrl("http://www.hao123.com/"))
# load the Web Page on the navigation Page http:// www.hao123.com
elif self.webview == '':self.webview = WebView(self)
# create blank New Page Label
self.webview.setZoomFactor(1.35)
# enlarge the display font size of the web page by 35%
self.webview.page().titleChanged.connect(self._title_changed)
# associating a Web Page title Change Signal to _ title _ changed method
self.webview.page().iconChanged.connect(self._icon_changed)
# method of associating a Page icon Change Signal to _ icon _ changed
self.initToolbar(self.webview)
Invocation initToolbar method
self.setCentralWidget(self.webview)
# to locate an instance of a Web page in the center of a tab window
self.webview.setContextMenuPolicy(Qt.CustomContextMenu)
# setting Web Page to custom Right-click context Menu
self.webview.customContextMenuRequested.connect(self.context_webmenu_event)
# request association method context _ webmenu _ event for setting webpage custom right-click text menu
webview_group.append(self.webview)
# adding the Web instance to the Web instance array variable
webview_parent_group.append(self.webview.parent())
# adding the parent instance of the Web Page to the array variable of the parent instance of the Web Page
if self.mainWin.INDEX==0:
If it is the first tab, then the following code is executed
self.webview.setParent(None)
# setting the parent instance of the present Web Page to None
self.webview.showFullScreen()
# maximize display of an instance of the present Page
webview_parent_group[0].grabKeyboard()
# setting the parent instance of the home page as the capture keyboard to enter full screen mode
… … omit extraneous code
def context_webmenu_event(self, point):
Method for processing # webpage right click menu
if self.webview == self.sender():
webview_parent_group[self.mainWin.INDEX].grabKeyboard()
Let the current window capture the keyboard and enter full screen mode
linkUrl = self.webview.page().contextMenuData().linkUrl().toString()
Url for # obtaining web page
editable = self.webview.page().contextMenuData().isContentEditable()
# get edit status of Web Page
mediaType = self.webview.page().contextMenuData().mediaType()
Type of # get control
context_menu = QMenu()
# construct mouse Right click Menu
close _ action = context _ menu.addaction (QIcon ('img/close.jpg'), "close")
context _ menu.addaction (qaaction (QIcon ('img/bookmark _ toolbar.jpg'), "my bookmark", ″)
/ self, triggered=self.mainWin.toolbar_bookmarks))
context _ menu.addaction (qaaction (QIcon (' img/view _ history.jpg '), "viewing footprint", self, /
/ triggered=self.mainWin.show_browsing_history))
context_menu.addAction(QAction(QIcon('img/bookmark_save_to_toolbar.jpg'), /
/"favorite bookmark", self, trigger = self. mainwin. add _ tool _ bar _ bookmark))
refresh _ action = context _ menu.addaction (QIcon ('img/refresh.jpg'), "refresh")
current_item = self.webview.url().toString()
refresh_action.setEnabled(current_item != 'about:blank')
if mediaType ==1:
If the control of right click is picture, the following code is executed
save _ image _ action = context _ menu.addaction (QIcon ('img/save.jpg'), "save picture")
copy _ image _ action = context _ menu.addaction (QIcon ('img/copy.jpg'), "copy picture")
chosen_action = self.common_actions(context_menu, refresh_action, close_action)
if chosen_action == save_image_action:self.mainWin.trigger( /
/ QWebEnginePage.DownloadImageToDisk)
elif chosen_action == copy_image_action:self.mainWin.trigger( /
/ QWebEnginePage.CopyImageToClipboard)
elif self.webview.page().hasSelection() and not editable:
context_menu = QMenu()
copy _ action = context _ menu.addaction (QIcon ('img/copy.jpg'), "copy")
chosen_action = context_menu.exec_(QCursor.pos())
if chosen_action == copy_action:self.mainWin.trigger( /
/ QWebEnginePage.Copy)
elif linkUrl=='' and not editable:
If right click is blank, the following code is executed
context _ menu.addaction (qaaction (QIcon ('img/clock.jpg'), "clock", "and/or @
/ self, triggered=self.mainWin.clock))
context _ menu.addaction (QAcon ('img/open _ dir. jpg'), "open download
Folder,/self, trigger = self. mainwin. open _ download _ dir))
tools _ submenu = context _ menu.addmenu (QIcon ('img/tools.jpg'), "toolbox")
tools_submenu.addAction(QAction(QIcon("img/wordpad.png"), /
/"easy tablet", self, trigger = self
tools_submenu.addAction(QAction(QIcon("img/screenshooter.png"), /
/"screen shot", self, trigger = self
tools_submenu.addAction(QAction(QIcon("img/pinta.png"), /
V "plot", self, trigger = self
tools_submenu.addAction(QAction(QIcon("img/printer.png"), /
/"Printer settings", self, trigger = self
tools_submenu.addAction(QAction(QIcon('img/wifi_volume.jpg'), /
V "network and volume", self, triggered = self
window_submenu = context_menu.addMenu(QIcon('img/zoom_in.jpg'),
V 'Window scaling')
window_submenu.addAction(QAction(QIcon("img/zoom_in.jpg"),
/"zoom in", self, trigger = self
window_submenu.addAction(QAction(QIcon("img/zoom_out.jpg"),
/"zoom out", self, trigger = self
window_submenu.addAction(QAction(QIcon("img/reset.jpg"), /
/"reset", self, trigger = self
bookmarks_submenu = context_menu.addMenu(QIcon( /
/'img/bookmark _ management. jpg'), "bookmark management")
bookmarks_submenu.addAction(QAction(QIcon('img/export_my_ /
Jpg'), "derived bookmark", self, triggered = self
bookmarks_submenu.addAction(QAction(QIcon('img/import_my_ /
Jpg'), "import bookmark", self, triggered = self
… … omit extraneous code
class MyBrowser(myQMainWindow):
# self-defining MyBrowser Main Window class, inheriting the MyQNainWindow class
def __init__(self):
super().__init__()
self.initWinTab()
# initialization Main Window and tab
self.newTab()
# creation of the first New Page tab
def initWinTab(self):
Method for initializing main window and tab
setWindowTitle ('hahahahayaya ultra-speed simple anti-theft Linux full-screen browser')
self.setWindowFlags(Qt.WindowCloseButtonHint)
The # setting main window only has one closing button without maximization and minimization buttons, and realizes the anti-theft
self.setWindowIcon(QIcon('img/hahayaya_logo1.png'))
self.sougou_tool_bar = QToolBar('')
# activating a toolbar for displaying a dog search input method, with empty contents, and auxiliary uses
self.tabWidget = QTabWidget()
self.tabWidget.setTabShape(QTabWidget.Triangular)
The style of the # setting tab is trapezoidal
self.tabWidget.setTabsClosable(True)
# settings tab closeable
self.tabWidget.tabCloseRequested.connect(self.close_Tab)
The # setup Tab close method is close _ Tab
self.tabWidget.currentChanged.connect(self.changeTab)
self.tabWidget.tabBarClicked.connect(self.clickTab)
self.setCentralWidget(self.tabWidget)
self.bookmark_widget = BookmarkWidget()
# bookmark class instantiation
self.bookmark_widget.open_bookmark.connect(self.load_url)
Bookmark _ toolbar = myQMenu ('my bookmark list')
self.bookmark_toolbar.setContextMenuPolicy(Qt.CustomContextMenu)
self.bookmark_toolbar.customContextMenuRequested.connect( /
/ self.context_toolbar_event)
Method for associating context _ toolbar _ event with # bookmark window right-click menu
self.bookmark_toolbar.setToolTipsVisible(True)
self.showMaximized()
# Main Window maximization display
… … omit extraneous code
def export_bookmark(self):
Method for deriving bookmark
self _dest _ path _ edge = self
Ok _ export _ bookmark)
Book _ UI2(' acknowledge ',485, 149, book _ export _ book, ' export my bookmark backup @
Save ", 'img/export _ bookmark. jpg', 705, 239)
def ok_export_bookmark(self):
Method for calling confirmation button of # export bookmark
self.dialog.close()
self.bookmark_widget._export_bookmarks(webview_group[self.INDEX],/
/self._dest_path_edit.text())
webview_parent_group[self.INDEX].grabKeyboard()
def bookmark_UI(self,label_1,label_x,label_y,edit_line_x,edit_line_y,edit_line_w,/
/edit_line_h,edit_line_def):
Common method for displaying label and text edit box of dialog box window
self.dialog = QDialog()
label1 = QLabel(label_1, self.dialog)
label1.move(label_x, label_y)
src_path = QStandardPaths.writableLocation(QStandardPaths.DownloadLocation) +/
/'/bookmark_hahayaya.html'
src_path_edit = QLineEdit(src_path, self.dialog)
src_path_edit.returnPressed.connect(edit_line_def)
src_path_edit.move(edit_line_x,edit_line_y)
src_path_edit.resize(edit_line_w,edit_line_h)
return src_path_edit
def bookmark_UI2(self,button_name,button_x,button_y,edit_line_def,title,pic,win_w,win_h):
Common method for displaying dialog box window button
btn2 = QPushButton(button_name, self.dialog)
btn2.move(button_x,button_y)
btn2.clicked.connect(edit_line_def)
btn2.setCursor(Qt.PointingHandCursor)
self.common_UI(title,pic,win_w,win_h)
def common_UI(self,title,pic,win_w,win_h):
Common method for displaying title, icon and the like of dialog box window
self.dialog.setWindowTitle(title)
self.dialog.setWindowIcon(QIcon(pic))
self.dialog.resize(win_w,win_h)
self.dialog.setWindowModality(Qt.ApplicationModal)
self.dialog.exec_()
def import_bookmark(self):
Method for processing # import bookmark
self _ src _ path _ edge = self
/20,67,105,65,520,25,self.ok_import_bookmark)
btn = self.button_common(self.dialog, 'img/open_dir.jpg', 50, 25, 635, 65)
btn.setCursor(Qt.PointingHandCursor)
setToolTip ('please select bookmark source file to import')
btn.clicked.connect(self.showFileDialog)
Bookmark _ UI2 ('acknowledge', 485, 149, self. ok _ import _ bookmark, 'import bookmark', 'up-or-down' bookmark
/'img/import_bookmark.jpg', 705, 239)
def showFileDialog(self):
Method for selecting bookmark source file by # pop-up directory and file selection dialog box
file1 = qfiledialog getopenfilename (webview _ group [ self
/bookmark source file ","/")
self._src_path_edit.setText(file1[0])
def ok_import_bookmark(self):
Method for # importing bookmark and pressing confirmation button
self.dialog.close()
if not os.path.exists('bookmarks/icon'):os.mkdir('bookmarks/icon')
m_bookmark=self.process_html_bookmark()
if m_bookmark is not None:
ret=self.bookmark_widget._import_bookmarks(m_bookmark,webview_group[ /
/ self.INDEX])
if ret:self.bookmark_widget.write_bookmarks()
webview_parent_group[self.INDEX].grabKeyboard()
def process_html_bookmark(self):
A utility method for # processing an import bookmark, comprising: google, 360, fire fox, IE, Edge and self-derived bookmark
import_file = self._src_path_edit.text()
if not os.path.exists(import_file):
Information (webview _ group [ self. INDEX ], ' import bookmark ', ' warming prompt
The/bookmark file \ n '+ import _ file +' does not exist! ')
return None
fp = open(import_file,'r',encoding='utf-8')
try:imported_bookmark = fp.read()
except:imported_bookmark = ''
fp.close()
if imported_bookmark == '':
Information (webview _ group [ self. INDEX ], ' import bookmark ', ' warming prompt
The/bookmark file \ n '+ import _ file +' format is incorrect! ')
return None
m_bookmark = []
href_ls = imported_bookmark.split('<A HREF="')
for i in range(1,len(href_ls)):
m_title, m_icon, m_url, m_mark_item = '', '', '', []
m_url=href_ls[i]
if m_url.find('ICON="') > -1:m_icon = m_url.split('ICON="')[1]
elif m_url.find('ICON_URI="') > -1:m_icon = m_url.split('ICON_URI="')[1]
title_ls = m_url.split('</A>')
m_title = title_ls[0]
m_url=m_url[0:m_url.find('"')]
try:m_title=m_title[m_title.rfind('>')+1:len(m_title)].rstrip()
except:pass
try:
m_icon=m_icon[0:m_icon.find('"')]
if m_icon.find('http')>-1:m_icon = ''
elif m_icon.find(';base64')>-1:
picfile = m_url[m_url.find('//')+2:len(m_url)]
picfile = picfile[0:picfile.find('/')]
picfile = picfile.replace('www.', '').replace('.', '__').replace('/', '_').replace('!', '~')
ls = m_icon.split(',')
dataType, base64_str = ls[0], ls[1]
dataType = dataType.replace('data=image/', '').replace('data:image/', /
/'').replace(';base64', '')
m_icon = self.base64_to_pic(base64_str,picfile,dataType)
except:pass
if m_url.find('http')>-1:
m_mark_item.append(m_url)
m_mark_item.append(m_title)
m_mark_item.append(m_icon)
m_bookmark.append(m_mark_item)
return m_bookmark
def base64_to_pic(self,base64_str,picfile,dataType):
# converting a string in base64 format to a picture file
save_file = 'bookmarks/icon/'+picfile+'.'+dataType
tu_b = base64.b64decode(base64_str)
with open(save_file, 'wb') as fp: fp.write(tu_b)
return save_file
def button_common(self,back,pic,width,height,x,y):
Common method for # display picture button
btn_1 = QPushButton('', back)
btn_1.setStyleSheet("QPushButton{border-image: url('"+pic+"')}")
btn_1.setFixedWidth(width)
btn_1.setFixedHeight(height)
btn_1.move(x, y)
return btn_1
… … omit extraneous code
if __name__ == "__main__":
# Main program
argvs = sys.argv
argvs.append("--no-sandbox")
QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
app = QApplication(argvs)
window = MyBrowser()
# instantiating the Main Window and Loading the Home Page
window.show()
# display Main Window
sys.exit(app.exec_())
The above full screen browser has 227 lines of code related to bookmark management, except for the comment line.

Claims (3)

1. Right clicking a mouse popup menu at any blank position of a browsed webpage to increase bookmark management, wherein secondary menus comprise: the bookmark is led out and led in, one level of menu is saved compared with a Google browser, and the user experience is greatly improved by right-clicking any blank position with a mouse.
Leading in a default source file of a bookmark window, namely leading out a default bookmark file; if the icon of the folder is clicked, the folder is opened to search any Html hypertext bookmark file originally stored in Google, 360, Firefox, IE or Edge browsers, the 'covering or bookmark adding' can be selected, and the system adopts the same section of code to introduce the icon, Url address, short title and long title of the common browser bookmark; the icon is ignored when the IE bookmark is imported, the icon needs to be downloaded in real time because the bookmark file of the IE does not contain icon information, the user experience is influenced, and the icon is updated when the IE bookmark is left on the internet; the 'exporting bookmark' displays a 'exporting my bookmark-backup saving' window, and the 'exporting my bookmark-backup saving' window is saved in a 'downloading' folder by default; only 227 lines of python code are green and environment-friendly.
3. Although the functions of claims 1-2 are implemented in a hahahayaya ultra-fast and simple anti-theft Linux full-screen browser developed on a Linux platform, the principles of claims 1-2 are suitable for browsers under various operating systems, including embedded browsers.
CN202011620214.0A 2020-12-31 2020-12-31 Universal and extremely simple html hypertext bookmark importing and exporting green program Pending CN112541139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011620214.0A CN112541139A (en) 2020-12-31 2020-12-31 Universal and extremely simple html hypertext bookmark importing and exporting green program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011620214.0A CN112541139A (en) 2020-12-31 2020-12-31 Universal and extremely simple html hypertext bookmark importing and exporting green program

Publications (1)

Publication Number Publication Date
CN112541139A true CN112541139A (en) 2021-03-23

Family

ID=75018013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011620214.0A Pending CN112541139A (en) 2020-12-31 2020-12-31 Universal and extremely simple html hypertext bookmark importing and exporting green program

Country Status (1)

Country Link
CN (1) CN112541139A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6549217B1 (en) * 2000-03-23 2003-04-15 Koninklijke Philips Electronics N.V. System and method for computer system management using bookmarks
CN1961312A (en) * 2004-06-24 2007-05-09 朴喜燮 Methods and the program-recording medium for creating, editing and trading home page components to assemble a home page and a personal portal site directly in wysiwyg on web browser
CN102567327A (en) * 2010-12-08 2012-07-11 腾讯科技(深圳)有限公司 Rapid input method and system of browser bookmarks
CN103685403A (en) * 2012-09-18 2014-03-26 腾讯科技(深圳)有限公司 Mobile browser bookmark moving method and device
CN104052782A (en) * 2013-03-15 2014-09-17 腾讯科技(深圳)有限公司 Information sharing method and system
CN104424260A (en) * 2013-08-29 2015-03-18 腾讯科技(深圳)有限公司 Browser information sharing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6549217B1 (en) * 2000-03-23 2003-04-15 Koninklijke Philips Electronics N.V. System and method for computer system management using bookmarks
CN1961312A (en) * 2004-06-24 2007-05-09 朴喜燮 Methods and the program-recording medium for creating, editing and trading home page components to assemble a home page and a personal portal site directly in wysiwyg on web browser
CN102567327A (en) * 2010-12-08 2012-07-11 腾讯科技(深圳)有限公司 Rapid input method and system of browser bookmarks
CN103685403A (en) * 2012-09-18 2014-03-26 腾讯科技(深圳)有限公司 Mobile browser bookmark moving method and device
CN104052782A (en) * 2013-03-15 2014-09-17 腾讯科技(深圳)有限公司 Information sharing method and system
CN104424260A (en) * 2013-08-29 2015-03-18 腾讯科技(深圳)有限公司 Browser information sharing method and device

Similar Documents

Publication Publication Date Title
EP2350812B1 (en) Modal-less interface enhancements
EP2742422B1 (en) Content preview
US7503012B2 (en) Invoking user designated actions based upon selected computer content
US8407576B1 (en) Situational web-based dashboard
US8972865B2 (en) Method and device for providing easy access to pre-selected data resources
US9171132B1 (en) Electronic note management system and user-interface
US8312388B2 (en) Information processing apparatus, information processing method and computer readable medium
US8949729B2 (en) Enhanced copy and paste between applications
US11442616B2 (en) Content-based directional placement application launch
US20100205559A1 (en) Quick-launch desktop application
US20130212463A1 (en) Smart document processing with associated online data and action streams
JP2008536200A (en) Method and system for displaying and interacting with paginated content
TW201508639A (en) Capturing website content through capture services
US20230004362A1 (en) Code execution and data processing pipeline
CN112487340A (en) Innovative technology of extremely-fast simple anti-theft Linux full-screen browser
US20140317155A1 (en) Research data collector and organizer
CN112541139A (en) Universal and extremely simple html hypertext bookmark importing and exporting green program
CN113608645A (en) Innovative technology for switching full-screen or window display and default full-screen browser at blank position of webpage by double-clicking of mouse
CN112256244A (en) Innovative technology of extremely-fast simple green Linux browser
US20160132514A1 (en) Creating optimized shortcuts
CN112506513A (en) Innovative software function for replacing forward and backward web page browsing by browsing footprint
CN112541138A (en) Simple, simplified and centered high-sensitivity one-level menu-type browser bookmark
US20200150859A1 (en) Method of operating widget on an electronic device
AU2011308901B2 (en) Content preview
WO2009029219A1 (en) Information retrieval using keywords from cursor positions on display

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210323