2022-03-29 10:03:05 +02:00
|
|
|
import org.kde.falkon 1.0 as Falkon
|
|
|
|
import QtQuick 2.3
|
|
|
|
|
|
|
|
Falkon.PluginInterface {
|
|
|
|
|
2022-03-29 22:41:19 +02:00
|
|
|
init: function(state, settingsPath) {
|
2022-03-29 10:03:05 +02:00
|
|
|
console.log(i18n('"Tutorial6" plugin loaded'))
|
|
|
|
tutorial3Object.clickCount = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
testPlugin: function() {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
unload: function() {
|
|
|
|
console.log(i18n('"Tutorial6" plugin unloaded'))
|
|
|
|
}
|
|
|
|
|
|
|
|
populateWebViewMenu: function(menu, webHitTestResult) {
|
|
|
|
/* Directly add actions to the menu */
|
|
|
|
var action_always = menu.addAction({
|
|
|
|
text: 'Copy something to the clipboard',
|
|
|
|
icon: 'falkon'
|
|
|
|
})
|
|
|
|
|
|
|
|
action_always.triggered.connect(function() {
|
|
|
|
Falkon.Clipboard.copy('Something from Falkon extension')
|
|
|
|
console.log(i18n('"Tutorial6" Something was copied to the clipboard'))
|
|
|
|
})
|
|
|
|
|
|
|
|
if (webHitTestResult.isImage()) {
|
|
|
|
var action_image = menu.addAction({
|
|
|
|
text: 'Image, copy URL',
|
|
|
|
icon: 'falkon'
|
|
|
|
})
|
|
|
|
|
|
|
|
action_image.triggered.connect(function() {
|
|
|
|
Falkon.Clipboard.copy(webHitTestResult.imageUrl)
|
|
|
|
console.log(i18n('"Tutorial6" Surprise, this is an image with url: ' + webHitTestResult.imageUrl))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|